Beispiel #1
0
 public function getFeaturedProjects($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseFeaturedProjectPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collFeaturedProjects === null) {
         if ($this->isNew()) {
             $this->collFeaturedProjects = array();
         } else {
             $criteria->add(FeaturedProjectPeer::PROJECT_ID, $this->getId());
             FeaturedProjectPeer::addSelectColumns($criteria);
             $this->collFeaturedProjects = FeaturedProjectPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(FeaturedProjectPeer::PROJECT_ID, $this->getId());
             FeaturedProjectPeer::addSelectColumns($criteria);
             if (!isset($this->lastFeaturedProjectCriteria) || !$this->lastFeaturedProjectCriteria->equals($criteria)) {
                 $this->collFeaturedProjects = FeaturedProjectPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastFeaturedProjectCriteria = $criteria;
     return $this->collFeaturedProjects;
 }
 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(FeaturedProjectPeer::ID, $pks, Criteria::IN);
         $objs = FeaturedProjectPeer::doSelect($criteria, $con);
     }
     return $objs;
 }