Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `
- public static function GetPhotosByType($offerId, $type = 'Zdjecie'){
- //var_dump($type);
- $allowedTypes = array('Zdjecie', 'Panorama', 'Rzut', 'Filmy');
- if(!in_array($type, $allowedTypes)) return false;
- $result = DataBase::GetDbInstance()->ExecuteQueryWithParams("SELECT * FROM #S#offers_photos WHERE offers_id=? AND type=? ORDER BY `order` ASC", array((int) $offerId, $type));
- $photos = array();
- $ndx = 0;
- while($row = DataBase::GetDbInstance()->FetchArray($result)){
- $photos[$ndx] = self::BuildPhoto($row);
- $ndx++;
- }
- return $photos;
- }
Advertisement
Add Comment
Please, Sign In to add comment