Skip to content
This repository has been archived by the owner on Jun 21, 2020. It is now read-only.

Commit

Permalink
wrote Sponsor::getSponsorsOfEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
parkr committed Feb 27, 2012
1 parent 6167977 commit 4da33fb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions classes/Sponsor.class.php
Expand Up @@ -45,6 +45,20 @@ public static function getAll($order = "name ASC"){
return $ret;
}

public static function getSponsorsOfEvent($event_id, $order = "name ASC"){
// returns array of Event objects.
$db = new DB();
$getManyQuery = "SELECT id FROM ".Sponsor::$useTable." WHERE event_id = $event_id ORDER BY ".$order;
$objs = $db->execute($getManyQuery);
$ret = array();
if($objs){
foreach($objs as $obj){
$ret[] = new Sponsor($obj['id']);
}
}
return $ret;
}

}

?>

0 comments on commit 4da33fb

Please sign in to comment.