/** * Deletes a orden * * @param string $orden_id */ public function deleteAction($orden_id) { $orden = Orden::findFirstByorden_id($orden_id); if (!$orden) { $this->flash->error("La orden no se encontró"); return $this->dispatcher->forward(array("controller" => "orden", "action" => "index")); } if (!$orden->delete()) { foreach ($orden->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array("controller" => "orden", "action" => "search")); } $this->flash->success("La orden se eliminó correctamente"); return $this->dispatcher->forward(array("controller" => "orden", "action" => "index")); }