コード例 #1
0
 protected function load_group($event = null, $id = null)
 {
     if (!$event) {
         $event = $this->load_event();
     }
     if (!$id) {
         $id = $this->getData('id');
     }
     $obj = SeatingGroup::find_by_id($id);
     if ($obj && $obj->event_id == $event->id) {
         return $obj;
     } else {
         throw new Error404('Unable to find the seating group');
     }
 }
コード例 #2
0
 protected static function get_fields()
 {
     return implode(', ', array(self::select_fields(), Event::select_fields(), SeatingGroup::select_fields()));
 }
コード例 #3
0
 public function seating_groups($reload = false)
 {
     if ($reload or !$this->seating_groups_cache) {
         $id = mysql_real_escape_string($this->id);
         $this->seating_groups_cache = SeatingGroup::find_all("events.id = '{$id}'");
     }
     return $this->seating_groups_cache;
 }