/** * @param bool|false $show_all * @param string $hotel_type * @return array * @throws Exception */ public function getHotels($show_all = false, $hotel_type = 'Primary') { $filters = array('Type' => $hotel_type, 'SummitID' => $this->ID); if (!$show_all) { $filters['DisplayOnSite'] = true; } return SummitHotel::get()->filter($filters)->sort('Order', 'ASC')->toArray(); }
public function thereIsSummitSessionOnHotel($hotel_id) { $summit = $this->Summit()->ID > 0 ? $this->Summit() : $this->CurrentSummit(); $hotel = SummitHotel::get()->byID(intval($hotel_id)); if (is_null($hotel)) { return false; } $venue = SummitVenue::get()->filter(array('SummitID' => $summit->ID, 'Name' => $hotel->Name))->first(); return !is_null($venue); }