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'); } }
protected static function get_fields() { return implode(', ', array(self::select_fields(), Event::select_fields(), SeatingGroup::select_fields())); }
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; }