Esempio n. 1
0
 public function getLocationsJoinLocationCondition($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseLocationPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collLocations === null) {
         if ($this->isNew()) {
             $this->collLocations = array();
         } else {
             $criteria->add(LocationPeer::LOCATION_CATEGORY_ID, $this->getId());
             $this->collLocations = LocationPeer::doSelectJoinLocationCondition($criteria, $con);
         }
     } else {
         $criteria->add(LocationPeer::LOCATION_CATEGORY_ID, $this->getId());
         if (!isset($this->lastLocationCriteria) || !$this->lastLocationCriteria->equals($criteria)) {
             $this->collLocations = LocationPeer::doSelectJoinLocationCondition($criteria, $con);
         }
     }
     $this->lastLocationCriteria = $criteria;
     return $this->collLocations;
 }
Esempio n. 2
0
 public function getLocationsRelatedByParentJoinLocationCondition($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseLocationPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collLocationsRelatedByParent === null) {
         if ($this->isNew()) {
             $this->collLocationsRelatedByParent = array();
         } else {
             $criteria->add(LocationPeer::PARENT, $this->getId());
             $this->collLocationsRelatedByParent = LocationPeer::doSelectJoinLocationCondition($criteria, $con);
         }
     } else {
         $criteria->add(LocationPeer::PARENT, $this->getId());
         if (!isset($this->lastLocationRelatedByParentCriteria) || !$this->lastLocationRelatedByParentCriteria->equals($criteria)) {
             $this->collLocationsRelatedByParent = LocationPeer::doSelectJoinLocationCondition($criteria, $con);
         }
     }
     $this->lastLocationRelatedByParentCriteria = $criteria;
     return $this->collLocationsRelatedByParent;
 }