filter->getCollection($this->collectionFactory->create()); $deleted = 0; foreach ($collection as $application) { $application->delete(); $deleted++; } $this->messageManager->addSuccessMessage( __('A total of %1 application(s) have been deleted.', $deleted) ); return $this->resultRedirectFactory->create()->setPath('*/*/'); } }