Пример #1
0
 public function getAccalActivitys($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseAccalActivityPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collAccalActivitys === null) {
         if ($this->isNew()) {
             $this->collAccalActivitys = array();
         } else {
             $criteria->add(AccalActivityPeer::ACTIVITY_TYPE_ID, $this->getId());
             AccalActivityPeer::addSelectColumns($criteria);
             $this->collAccalActivitys = AccalActivityPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(AccalActivityPeer::ACTIVITY_TYPE_ID, $this->getId());
             AccalActivityPeer::addSelectColumns($criteria);
             if (!isset($this->lastAccalActivityCriteria) || !$this->lastAccalActivityCriteria->equals($criteria)) {
                 $this->collAccalActivitys = AccalActivityPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastAccalActivityCriteria = $criteria;
     return $this->collAccalActivitys;
 }
Пример #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(AccalActivityPeer::ID, $pks, Criteria::IN);
         $objs = AccalActivityPeer::doSelect($criteria, $con);
     }
     return $objs;
 }