public function getStudentLeaves($criteria = null, $con = null) { include_once 'lib/model/om/BaseStudentLeavePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collStudentLeaves === null) { if ($this->isNew()) { $this->collStudentLeaves = array(); } else { $criteria->add(StudentLeavePeer::ACADEMIC_CALENDAR_ID, $this->getId()); StudentLeavePeer::addSelectColumns($criteria); $this->collStudentLeaves = StudentLeavePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(StudentLeavePeer::ACADEMIC_CALENDAR_ID, $this->getId()); StudentLeavePeer::addSelectColumns($criteria); if (!isset($this->lastStudentLeaveCriteria) || !$this->lastStudentLeaveCriteria->equals($criteria)) { $this->collStudentLeaves = StudentLeavePeer::doSelect($criteria, $con); } } } $this->lastStudentLeaveCriteria = $criteria; return $this->collStudentLeaves; }
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(StudentLeavePeer::ID, $pks, Criteria::IN); $objs = StudentLeavePeer::doSelect($criteria, $con); } return $objs; }