/** * Gets an array of Missatgesllistes objects which contain a foreign key that references this object. * * If this collection has already been initialized with an identical Criteria, it returns the collection. * Otherwise if this Missatgesmailing has previously been saved, it will retrieve * related Missatgesllistess from storage. If this Missatgesmailing is new, it will return * an empty collection or the current collection, the criteria is ignored on a new object. * * @param PropelPDO $con * @param Criteria $criteria * @return array Missatgesllistes[] * @throws PropelException */ public function getMissatgesllistess($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(MissatgesmailingPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collMissatgesllistess === null) { if ($this->isNew()) { $this->collMissatgesllistess = array(); } else { $criteria->add(MissatgesllistesPeer::IDMISSATGESLLISTES, $this->idmissatge); MissatgesllistesPeer::addSelectColumns($criteria); $this->collMissatgesllistess = MissatgesllistesPeer::doSelect($criteria, $con); } } else { // criteria has no effect for a new object if (!$this->isNew()) { // the following code is to determine if a new query is // called for. If the criteria is the same as the last // one, just return the collection. $criteria->add(MissatgesllistesPeer::IDMISSATGESLLISTES, $this->idmissatge); MissatgesllistesPeer::addSelectColumns($criteria); if (!isset($this->lastMissatgesllistesCriteria) || !$this->lastMissatgesllistesCriteria->equals($criteria)) { $this->collMissatgesllistess = MissatgesllistesPeer::doSelect($criteria, $con); } } } $this->lastMissatgesllistesCriteria = $criteria; return $this->collMissatgesllistess; }
/** * Retrieve object using using composite pkey values. * @param int $idmissatgesllistes * @param int $llistes_idllistes * @param PropelPDO $con * @return Missatgesllistes */ public static function retrieveByPK($idmissatgesllistes, $llistes_idllistes, PropelPDO $con = null) { $key = serialize(array((string) $idmissatgesllistes, (string) $llistes_idllistes)); if (null !== ($obj = MissatgesllistesPeer::getInstanceFromPool($key))) { return $obj; } if ($con === null) { $con = Propel::getConnection(MissatgesllistesPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $criteria = new Criteria(MissatgesllistesPeer::DATABASE_NAME); $criteria->add(MissatgesllistesPeer::IDMISSATGESLLISTES, $idmissatgesllistes); $criteria->add(MissatgesllistesPeer::LLISTES_IDLLISTES, $llistes_idllistes); $v = MissatgesllistesPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }