Exemple #1
0
 /**
  * Habilitar un transporte.
  * @return bool
  */
 public function habilitarAction($idviaje)
 {
     $viaje = Viaje::findFirstByViaje_id($idviaje);
     $viaje->viaje_habilitado = 1;
     if (!$viaje->update()) {
         foreach ($viaje->getMessages() as $message) {
             $this->flash->error($message);
         }
         return $this->dispatcher->forward(array("controller" => "viaje", "action" => "search"));
     }
     $this->flash->success("El viaje ha sido habilitado");
     return $this->dispatcher->forward(array("controller" => "viaje", "action" => "search"));
 }