/** * Retrieve object using using composite pkey values. * @param int $idllista * @param string $email * @param PropelPDO $con * @return MissatgesEmails */ public static function retrieveByPK($idllista, $email, PropelPDO $con = null) { $key = serialize(array((string) $idllista, (string) $email)); if (null !== ($obj = MissatgesEmailsPeer::getInstanceFromPool($key))) { return $obj; } if ($con === null) { $con = Propel::getConnection(MissatgesEmailsPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $criteria = new Criteria(MissatgesEmailsPeer::DATABASE_NAME); $criteria->add(MissatgesEmailsPeer::IDLLISTA, $idllista); $criteria->add(MissatgesEmailsPeer::EMAIL, $email); $v = MissatgesEmailsPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }
/** * Gets an array of MissatgesEmails 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 Llistes has previously been saved, it will retrieve * related MissatgesEmailss from storage. If this Llistes 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 MissatgesEmails[] * @throws PropelException */ public function getMissatgesEmailss($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(LlistesPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collMissatgesEmailss === null) { if ($this->isNew()) { $this->collMissatgesEmailss = array(); } else { $criteria->add(MissatgesEmailsPeer::IDLLISTA, $this->idllistes); MissatgesEmailsPeer::addSelectColumns($criteria); $this->collMissatgesEmailss = MissatgesEmailsPeer::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(MissatgesEmailsPeer::IDLLISTA, $this->idllistes); MissatgesEmailsPeer::addSelectColumns($criteria); if (!isset($this->lastMissatgesEmailsCriteria) || !$this->lastMissatgesEmailsCriteria->equals($criteria)) { $this->collMissatgesEmailss = MissatgesEmailsPeer::doSelect($criteria, $con); } } } $this->lastMissatgesEmailsCriteria = $criteria; return $this->collMissatgesEmailss; }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(MissatgesEmailsPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(MissatgesEmailsPeer::DATABASE_NAME); $criteria->add(MissatgesEmailsPeer::IDEMAIL, $pks, Criteria::IN); $objs = MissatgesEmailsPeer::doSelect($criteria, $con); } return $objs; }