コード例 #1
0
ファイル: BaseNgRegPeriod.php プロジェクト: taryono/school
 public function getNgRegPeriodRules($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseNgRegPeriodRulePeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collNgRegPeriodRules === null) {
         if ($this->isNew()) {
             $this->collNgRegPeriodRules = array();
         } else {
             $criteria->add(NgRegPeriodRulePeer::NG_REG_PERIOD_ID, $this->getId());
             NgRegPeriodRulePeer::addSelectColumns($criteria);
             $this->collNgRegPeriodRules = NgRegPeriodRulePeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(NgRegPeriodRulePeer::NG_REG_PERIOD_ID, $this->getId());
             NgRegPeriodRulePeer::addSelectColumns($criteria);
             if (!isset($this->lastNgRegPeriodRuleCriteria) || !$this->lastNgRegPeriodRuleCriteria->equals($criteria)) {
                 $this->collNgRegPeriodRules = NgRegPeriodRulePeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastNgRegPeriodRuleCriteria = $criteria;
     return $this->collNgRegPeriodRules;
 }
コード例 #2
0
 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(NgRegPeriodRulePeer::ID, $pks, Criteria::IN);
         $objs = NgRegPeriodRulePeer::doSelect($criteria, $con);
     }
     return $objs;
 }