Esempio n. 1
0
 public static function initialize($idER = 0)
 {
     $OER = self::retrieveByPK($idER);
     if (!$OER instanceof EntradesReserva) {
         $OER = new EntradesReserva();
         $OER->setUsuariid(null);
         $OER->setActivitatsid(null);
         $OER->setQuantes(0);
         $OER->setData(date('Y-m-d H:i', time()));
     }
     return new EntradesReservaForm($OER);
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      EntradesReserva $value A EntradesReserva object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(EntradesReserva $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getIdentrada();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
 public static function initialize($idS, $url_ajax_usuaris, $idER, $idH, $idU = 0, $quantitat = 0, $Descompte = 0, $TPagament = 0)
 {
     $OER = self::retrieveByPK($idER);
     if (!$OER instanceof EntradesReserva) {
         $OER = new EntradesReserva();
         $OER->setEntradesPreusHorariId($idH == 0 ? null : $idH);
         $OER->setUsuariid($idU == 0 ? null : $idU);
         $OER->setNomReserva(null);
         $OER->setEmailReserva(null);
         $OER->setTelefonReserva(null);
         $OER->setQuantitat($quantitat);
         $OER->setEstat(self::ESTAT_ENTRADA_EN_ESPERA);
         $OER->setActiu(true);
         $OER->setDescompte($Descompte);
         $OER->setSiteid($idS);
         $OER->setData(date('Y-m-d H:i', time()));
         $OER->setTipusPagament($TPagament);
     }
     return new EntradesReservaForm($OER, array('ajax' => $url_ajax_usuaris, 'IDH' => $idH));
 }