public static function getLightboxArray($entity, $entity_id)
 {
     $images = array();
     $c = new Criteria();
     $c->add(sfPhotoGalleryPeer::ENTITY, $entity);
     $c->add(sfPhotoGalleryPeer::ENTITY_ID, $entity_id);
     $c->setIgnoreCase(true);
     $photos = sfPhotoGalleryPeer::doSelect($c);
     if (count($photos) > 0) {
         foreach ($photos as $photo) {
             $images[] = array('real_name' => $photo->getRealName(), 'options' => array('title' => $photo->getDescription()));
         }
     }
     return $images;
 }
Beispiel #2
0
 public function executeList()
 {
     $this->photos = sfPhotoGalleryPeer::doSelect(new Criteria());
 }
 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(sfPhotoGalleryPeer::ID, $pks, Criteria::IN);
         $objs = sfPhotoGalleryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }