I was wondering if there was a way of walking through a collection on Magento 2 and deleting entries from the database.
In Magento 1, this could be done by doing something like the following:
Mage::getModel('foo/bar')->getCollection()
->addFilter('baz', $filter)
->walk('delete')
Is there a way of achieving something similar in Magento 2?
Best Answer
It's the same method in M2 you can do
A few examples from native Magento 2 files: