Guest User

Untitled

a guest
Dec 13th, 2015
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.  
  2. `
  3.     public static function GetPhotosByType($offerId, $type = 'Zdjecie'){
  4.         //var_dump($type);
  5.         $allowedTypes = array('Zdjecie', 'Panorama', 'Rzut', 'Filmy');
  6.         if(!in_array($type, $allowedTypes)) return false;
  7.        
  8.         $result = DataBase::GetDbInstance()->ExecuteQueryWithParams("SELECT * FROM #S#offers_photos WHERE offers_id=? AND type=? ORDER BY `order` ASC", array((int) $offerId, $type));
  9.         $photos = array();
  10.         $ndx = 0;
  11.         while($row = DataBase::GetDbInstance()->FetchArray($result)){
  12.             $photos[$ndx] = self::BuildPhoto($row);
  13.             $ndx++;
  14.         }
  15.         return $photos;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment