Exemple #1
0
 public static function getParents()
 {
     $parents = array();
     foreach (ColLocationPeer::doSelect(new Criteria()) as $d) {
         if (count($d->getColLocationRelatedByParent()) > 0) {
             $parents[] = $d->getId();
         }
     }
     return $parents;
 }
 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(ColLocationPeer::ID, $pks, Criteria::IN);
         $objs = ColLocationPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Exemple #3
0
 public function executeGetListName()
 {
     if ($this->hasRequestParameter('col_name') && $this->getRequestParameter('col_name') != '') {
         $c = new Criteria();
         $cton1 = $c->getNewCriterion(ColLocationPeer::NAME, '%' . $this->getRequestParameter('col_name') . '%', Criteria::LIKE);
         $cton2 = $c->getNewCriterion(ColLocationPeer::CODE, '%' . $this->getRequestParameter('col_name') . '%', Criteria::LIKE);
         $cton3 = $c->getNewCriterion(ColLocationPeer::DEPARTMENT_ID, '%' . $this->getRequestParameter('col_name') . '%', Criteria::LIKE);
         $cton2->addOr($cton3);
         $cton1->addOr($cton2);
         $c->add($cton1);
         $this->rows = ColLocationPeer::doSelect($c);
     }
 }
Exemple #4
0
 public function getColLocationsRelatedByParent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseColLocationPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collColLocationsRelatedByParent === null) {
         if ($this->isNew()) {
             $this->collColLocationsRelatedByParent = array();
         } else {
             $criteria->add(ColLocationPeer::PARENT, $this->getId());
             ColLocationPeer::addSelectColumns($criteria);
             $this->collColLocationsRelatedByParent = ColLocationPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ColLocationPeer::PARENT, $this->getId());
             ColLocationPeer::addSelectColumns($criteria);
             if (!isset($this->lastColLocationRelatedByParentCriteria) || !$this->lastColLocationRelatedByParentCriteria->equals($criteria)) {
                 $this->collColLocationsRelatedByParent = ColLocationPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastColLocationRelatedByParentCriteria = $criteria;
     return $this->collColLocationsRelatedByParent;
 }