/** * Deletes a remito * * @param string $remito_id */ public function deleteAction($remito_id) { $remito = Remito::findFirstByremito_id($remito_id); if (!$remito) { $this->flash->error("remito was not found"); return $this->dispatcher->forward(array("controller" => "remito", "action" => "index")); } if (!$remito->delete()) { foreach ($remito->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array("controller" => "remito", "action" => "search")); } $this->flash->success("remito was deleted successfully"); return $this->dispatcher->forward(array("controller" => "remito", "action" => "index")); }