Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2014
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. public static function getGalleryEvents($limit = 0) {
  2.         $events = Event::get();
  3.         $gallery_events = ArrayList::create();
  4.  
  5.         foreach($events as $event) {
  6.             if($event->Images()->exists()) {
  7.                 $gallery_events->push($event);
  8.             }
  9.         }
  10.  
  11.         return $gallery_events->limit($limit);
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement