/**
  * Handle the delete all action.
  *
  * @param ModelId[] $modelIds The list of model ids.
  *
  * @return void
  */
 protected function handleDeleteAllAction($modelIds)
 {
     $handler = new DeleteHandler();
     $handler->setEnvironment($this->getEnvironment());
     foreach ($modelIds as $modelId) {
         $handler->delete($modelId);
     }
     ViewHelpers::redirectHome($this->getEnvironment());
 }
Example #2
0
 /**
  * Handle the delete all action.
  *
  * @param ModelId[] $modelIds The list of model ids.
  *
  * @return void
  */
 protected function handleDeleteAllAction($modelIds)
 {
     $handler = new DeleteHandler();
     $handler->setEnvironment($this->getEnvironment());
     foreach ($modelIds as $modelId) {
         // TODO: How to handle errors for one item? Abort and roll back or just log it and print the messages?
         $handler->delete($modelId);
     }
     ViewHelpers::redirectHome($this->getEnvironment());
 }