public function getLocationsRelatedByParentJoinAcademicCalendar($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::doSelectJoinAcademicCalendar($criteria, $con); } } else { $criteria->add(LocationPeer::PARENT, $this->getId()); if (!isset($this->lastLocationRelatedByParentCriteria) || !$this->lastLocationRelatedByParentCriteria->equals($criteria)) { $this->collLocationsRelatedByParent = LocationPeer::doSelectJoinAcademicCalendar($criteria, $con); } } $this->lastLocationRelatedByParentCriteria = $criteria; return $this->collLocationsRelatedByParent; }