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