Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1.     /**
  2.      * Return events from all businesses owned by a user.
  3.      * Note: Returns generic objects like fetch_orig().
  4.      */
  5.     public function events () {
  6.         $businesses = self::query ()->where ('owner', $this->id)->fetch_field ('id');
  7.        
  8.         $qmarks = array_fill (0, count ($businesses), '?');
  9.        
  10.         return DB::fetch (
  11.             'select * from #prefix#myapp_event where id in(' . join(',', $qmarks) . ')',
  12.             $businesses
  13.         )
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement