I have custom module with mass delete action feature. how to do mass delete action in one step without loop. Because i got WARNING | Model LSD method delete() detected in loop when i check my module in MEQP 2.
Below is the code used in my module
foreach ($collection as $block)
{
$block->delete();
}
After searching the mass action in the MAGE2 core file they too use the same method. i refered the following path file is vendor/magento/module-cms/Controller/Adminhtml/Block/MassDelete.php
from line no 51 to 53
foreach ($collection as $page)
{
$page->delete();
}
i appreciate any one help on this.