public static function doSelectFiltered(Criteria $criteria, $con = null) { return CatSubjectPeer::doSelect($criteria); }
public function executeGetListName() { if ($this->hasRequestParameter('cat_subject_name') && $this->getRequestParameter('cat_subject_name') != '') { $c = new Criteria(); $cton1 = $c->getNewCriterion(CatSubjectPeer::NAME, '%' . $this->getRequestParameter('cat_subject_name') . '%', Criteria::LIKE); $cton2 = $c->getNewCriterion(CatSubjectPeer::CODE, '%' . $this->getRequestParameter('cat_subject_name') . '%', Criteria::LIKE); //$c->add(CatSubjectPeer::NAME, '%'.$this->getRequestParameter('cat_subject_name').'%', Criteria::LIKE); $cton1->addOr($cton2); $c->add($cton1); //$this->rows = CatSubjectPeer::doSelect($c); $this->rows = CatSubjectPeer::doSelect($c); } }
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(CatSubjectPeer::ID, $pks, Criteria::IN); $objs = CatSubjectPeer::doSelect($criteria, $con); } return $objs; }
public function executeGetChild() { $id = $this->getRequestParameter('id'); $this->forward404Unless($id); $level = $this->getRequestParameter('level'); if ($level == null) { $level = 0; } $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $c = new Criteria(); $c->add(JobPeer::CODE, $this->getModuleName()); $job = JobPeer::doSelectOne($c); $acl = AclPeer::retrieveByPK($group_id, $job->getId()); $this->can_add = $acl->getAddPriv() == 1; $this->can_edit = $acl->getEditPriv() == 1; $this->can_remove = $acl->getRemovePriv() == 1; $c = new Criteria(); $c->add(CatSubjectPeer::PARENT, $id); $c->addAscendingOrderByColumn(CatSubjectPeer::CODE); $this->rows = CatSubjectPeer::doSelect($c); $this->level = $level + 1; $this->parent_id = $id; $this->parent_class = $this->getRequestParameter('parent_class'); }
public function getCatSubjectsRelatedByParent($criteria = null, $con = null) { include_once 'lib/model/om/BaseCatSubjectPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCatSubjectsRelatedByParent === null) { if ($this->isNew()) { $this->collCatSubjectsRelatedByParent = array(); } else { $criteria->add(CatSubjectPeer::PARENT, $this->getId()); CatSubjectPeer::addSelectColumns($criteria); $this->collCatSubjectsRelatedByParent = CatSubjectPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(CatSubjectPeer::PARENT, $this->getId()); CatSubjectPeer::addSelectColumns($criteria); if (!isset($this->lastCatSubjectRelatedByParentCriteria) || !$this->lastCatSubjectRelatedByParentCriteria->equals($criteria)) { $this->collCatSubjectsRelatedByParent = CatSubjectPeer::doSelect($criteria, $con); } } } $this->lastCatSubjectRelatedByParentCriteria = $criteria; return $this->collCatSubjectsRelatedByParent; }