public function construct()
 {
     if ($this->isNew()) {
         try {
             parent::construct();
             $this->setEstado(EstadoPedido::pendiente());
             $this->setFecha(DateUtil::formatAsTimeStamp(time()));
             $this->setNumero(Restaurant::getInstance()->pedidos()->count() + 1);
         } catch (Exception $e) {
             /**
              * This try/catch clause is necessary to prevent the Doctrine data loader command from
              * failing.
              *
              */
         }
     }
 }
Esempio n. 2
0
 /**
  * @return Pedido
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }