public function getProductCategoryI18ns($criteria = null, $con = null) { include_once 'lib/model/om/BaseProductCategoryI18nPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collProductCategoryI18ns === null) { if ($this->isNew()) { $this->collProductCategoryI18ns = array(); } else { $criteria->add(ProductCategoryI18nPeer::ID, $this->getId()); ProductCategoryI18nPeer::addSelectColumns($criteria); $this->collProductCategoryI18ns = ProductCategoryI18nPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(ProductCategoryI18nPeer::ID, $this->getId()); ProductCategoryI18nPeer::addSelectColumns($criteria); if (!isset($this->lastProductCategoryI18nCriteria) || !$this->lastProductCategoryI18nCriteria->equals($criteria)) { $this->collProductCategoryI18ns = ProductCategoryI18nPeer::doSelect($criteria, $con); } } } $this->lastProductCategoryI18nCriteria = $criteria; return $this->collProductCategoryI18ns; }
public static function retrieveByPK($id, $culture, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $criteria = new Criteria(); $criteria->add(ProductCategoryI18nPeer::ID, $id); $criteria->add(ProductCategoryI18nPeer::CULTURE, $culture); $v = ProductCategoryI18nPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }