/** * Retrieve object using using composite pkey values. * @param int $id * @param string $culture * @param PropelPDO $con * @return PartidoI18n */ public static function retrieveByPK($id, $culture, PropelPDO $con = null) { $key = serialize(array((string) $id, (string) $culture)); if (null !== ($obj = PartidoI18nPeer::getInstanceFromPool($key))) { return $obj; } if ($con === null) { $con = Propel::getConnection(PartidoI18nPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $criteria = new Criteria(PartidoI18nPeer::DATABASE_NAME); $criteria->add(PartidoI18nPeer::ID, $id); $criteria->add(PartidoI18nPeer::CULTURE, $culture); $v = PartidoI18nPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }
/** * Gets an array of PartidoI18n 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 Partido has previously been saved, it will retrieve * related PartidoI18ns from storage. If this Partido 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 PartidoI18n[] * @throws PropelException */ public function getPartidoI18ns($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(PartidoPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collPartidoI18ns === null) { if ($this->isNew()) { $this->collPartidoI18ns = array(); } else { $criteria->add(PartidoI18nPeer::ID, $this->id); PartidoI18nPeer::addSelectColumns($criteria); $this->collPartidoI18ns = PartidoI18nPeer::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(PartidoI18nPeer::ID, $this->id); PartidoI18nPeer::addSelectColumns($criteria); if (!isset($this->lastPartidoI18nCriteria) || !$this->lastPartidoI18nCriteria->equals($criteria)) { $this->collPartidoI18ns = PartidoI18nPeer::doSelect($criteria, $con); } } } $this->lastPartidoI18nCriteria = $criteria; return $this->collPartidoI18ns; }