示例#1
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Agency is new, it will return
  * an empty collection; or if this Agency has previously
  * been saved, it will retrieve related MissionsRelatedByOtherAgencyId from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Agency.
  */
 public function getMissionsRelatedByOtherAgencyIdJoinCamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(AgencyPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collMissionsRelatedByOtherAgencyId === null) {
         if ($this->isNew()) {
             $this->collMissionsRelatedByOtherAgencyId = array();
         } else {
             $criteria->add(MissionPeer::OTHER_AGENCY_ID, $this->id);
             $this->collMissionsRelatedByOtherAgencyId = MissionPeer::doSelectJoinCamp($criteria, $con, $join_behavior);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(MissionPeer::OTHER_AGENCY_ID, $this->id);
         if (!isset($this->lastMissionRelatedByOtherAgencyIdCriteria) || !$this->lastMissionRelatedByOtherAgencyIdCriteria->equals($criteria)) {
             $this->collMissionsRelatedByOtherAgencyId = MissionPeer::doSelectJoinCamp($criteria, $con, $join_behavior);
         }
     }
     $this->lastMissionRelatedByOtherAgencyIdCriteria = $criteria;
     return $this->collMissionsRelatedByOtherAgencyId;
 }
示例#2
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Coordinator is new, it will return
  * an empty collection; or if this Coordinator has previously
  * been saved, it will retrieve related Missions from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Coordinator.
  */
 public function getMissionsJoinCamp($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     if ($criteria === null) {
         $criteria = new Criteria(CoordinatorPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collMissions === null) {
         if ($this->isNew()) {
             $this->collMissions = array();
         } else {
             $criteria->add(MissionPeer::COORDINATOR_ID, $this->id);
             $this->collMissions = MissionPeer::doSelectJoinCamp($criteria, $con, $join_behavior);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(MissionPeer::COORDINATOR_ID, $this->id);
         if (!isset($this->lastMissionCriteria) || !$this->lastMissionCriteria->equals($criteria)) {
             $this->collMissions = MissionPeer::doSelectJoinCamp($criteria, $con, $join_behavior);
         }
     }
     $this->lastMissionCriteria = $criteria;
     return $this->collMissions;
 }