/** * Resets all references to other model objects or collections of model objects. * * This method is a user-space workaround for PHP's inability to garbage collect * objects with circular references (even in PHP 5.3). This is currently necessary * when using Propel in certain daemon or large-volume/high-memory operations. * * @param boolean $deep Whether to also clear the references on all referrer objects. */ public function clearAllReferences($deep = false) { if ($deep && !$this->alreadyInClearAllReferencesDeep) { $this->alreadyInClearAllReferencesDeep = true; if ($this->collAdmisionanticipos) { foreach ($this->collAdmisionanticipos as $o) { $o->clearAllReferences($deep); } } if ($this->collCargoadmisions) { foreach ($this->collCargoadmisions as $o) { $o->clearAllReferences($deep); } } if ($this->collFacturas) { foreach ($this->collFacturas as $o) { $o->clearAllReferences($deep); } } if ($this->aCuarto instanceof Persistent) { $this->aCuarto->clearAllReferences($deep); } if ($this->aMedico instanceof Persistent) { $this->aMedico->clearAllReferences($deep); } if ($this->aPaciente instanceof Persistent) { $this->aPaciente->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) if ($this->collAdmisionanticipos instanceof PropelCollection) { $this->collAdmisionanticipos->clearIterator(); } $this->collAdmisionanticipos = null; if ($this->collCargoadmisions instanceof PropelCollection) { $this->collCargoadmisions->clearIterator(); } $this->collCargoadmisions = null; if ($this->collFacturas instanceof PropelCollection) { $this->collFacturas->clearIterator(); } $this->collFacturas = null; $this->aCuarto = null; $this->aMedico = null; $this->aPaciente = null; }
/** * 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 Cuarto $obj A Cuarto object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getIdcuarto(); } // if key === null CuartoPeer::$instances[$key] = $obj; } }
/** * Filter the query by a related Cuarto object * * @param Cuarto|PropelObjectCollection $cuarto The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return AdmisionQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByCuarto($cuarto, $comparison = null) { if ($cuarto instanceof Cuarto) { return $this->addUsingAlias(AdmisionPeer::IDCUARTO, $cuarto->getIdcuarto(), $comparison); } elseif ($cuarto instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(AdmisionPeer::IDCUARTO, $cuarto->toKeyValue('PrimaryKey', 'Idcuarto'), $comparison); } else { throw new PropelException('filterByCuarto() only accepts arguments of type Cuarto or PropelCollection'); } }
/** * Exclude object from result * * @param Cuarto $cuarto Object to remove from the list of results * * @return CuartoQuery The current query, for fluid interface */ public function prune($cuarto = null) { if ($cuarto) { $this->addUsingAlias(CuartoPeer::IDCUARTO, $cuarto->getIdcuarto(), Criteria::NOT_EQUAL); } return $this; }