Example #1
0
 public static function getFiles($entity, $entity_id)
 {
     $c = new Criteria();
     $c->add(sfFileGalleryPeer::ENTITY, $entity);
     $c->add(sfFileGalleryPeer::ENTITY_ID, $entity_id);
     $files = sfFileGalleryPeer::doSelect($c);
     return $files;
 }
Example #2
0
 public function getsfFileGallerys($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BasesfFileGalleryPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collsfFileGallerys === null) {
         if ($this->isNew()) {
             $this->collsfFileGallerys = array();
         } else {
             $criteria->add(sfFileGalleryPeer::UPLOADED_BY, $this->getId());
             sfFileGalleryPeer::addSelectColumns($criteria);
             $this->collsfFileGallerys = sfFileGalleryPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(sfFileGalleryPeer::UPLOADED_BY, $this->getId());
             sfFileGalleryPeer::addSelectColumns($criteria);
             if (!isset($this->lastsfFileGalleryCriteria) || !$this->lastsfFileGalleryCriteria->equals($criteria)) {
                 $this->collsfFileGallerys = sfFileGalleryPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastsfFileGalleryCriteria = $criteria;
     return $this->collsfFileGallerys;
 }
 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(sfFileGalleryPeer::ID, $pks, Criteria::IN);
         $objs = sfFileGalleryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #4
0
 public function executeList()
 {
     $this->file = sfFileGalleryPeer::doSelect(new Criteria());
 }