Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 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;
 }