/** * Declares an association between this object and a Cessio object. * * @param Cessio $v * @return Cessiomaterial The current object (for fluent API support) * @throws PropelException */ public function setCessio(Cessio $v = null) { if ($v === null) { $this->setCessioId(NULL); } else { $this->setCessioId($v->getCessioId()); } $this->aCessio = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Cessio object, it will not be re-added. if ($v !== null) { $v->addCessiomaterial($this); } return $this; }
static function inicialitza($id, $idS, $retorn = false) { $OC = self::retrieveByPK($id); if ($OC instanceof Cessio) { if ($retorn) { $OC->setEstatRetornat(""); $OC->setDataretornat(date('Y-m-d', time())); return new CessiomaterialRetornForm($OC, array('IDS' => $idS)); } else { return new CessioForm($OC, array('IDS' => $idS)); } } else { $OC = new Cessio(); $OC->setRetornat(false); $OC->setUsuariId(null); $OC->setEstatRetornat(""); $OC->setDataretornat(null); $OC->setDatacessio(date('m/d/Y', time())); $OC->setDataretorn(date('m/d/Y', time())); $OC->setMotiu(OptionsPeer::getString('CESSIO_TEXT_MOTIU', $idS)); $OC->setCondicions(OptionsPeer::getString('CESSIO_TEXT_CONDICIONS', $idS)); $OC->setSiteId($idS); $OC->setActiu(true); if ($retorn) { $OC->setRetornat(true); $OC->setEstatRetornat(""); $OC->setDataretornat(date('Y-m-d', time())); return new CessiomaterialRetornForm($OC, array('IDS' => $idS)); } else { return new CessioForm($OC, array('IDS' => $idS)); } } }
/** * 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 Cessio $value A Cessio object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(Cessio $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getCessioId(); } // if key === null self::$instances[$key] = $obj; } }