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