public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(CatCategoryPeer::ID, $pks, Criteria::IN); $objs = CatCategoryPeer::doSelect($criteria, $con); } return $objs; }
public function executeGetList() { if ($this->hasRequestParameter('category_name') && $this->getRequestParameter('category_name') != '') { $name = $this->getRequestParameter('category_name'); $c = new Criteria(); $c->add(CatCategoryPeer::NAME, "%{$name}%", Criteria::LIKE); $this->rows = CatCategoryPeer::doSelect($c); } }
public function getCatCategorys($criteria = null, $con = null) { include_once 'lib/model/om/BaseCatCategoryPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCatCategorys === null) { if ($this->isNew()) { $this->collCatCategorys = array(); } else { $criteria->add(CatCategoryPeer::CAT_TEMPLATE_ID, $this->getId()); CatCategoryPeer::addSelectColumns($criteria); $this->collCatCategorys = CatCategoryPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(CatCategoryPeer::CAT_TEMPLATE_ID, $this->getId()); CatCategoryPeer::addSelectColumns($criteria); if (!isset($this->lastCatCategoryCriteria) || !$this->lastCatCategoryCriteria->equals($criteria)) { $this->collCatCategorys = CatCategoryPeer::doSelect($criteria, $con); } } } $this->lastCatCategoryCriteria = $criteria; return $this->collCatCategorys; }