private function getData() { $this->room = FrontendHotelsModel::getRoom($this->id); if (empty($this->room)) { http_response_code(404); } }
private function getData() { $start = $this->URL->getParameter('start'); $end = $this->URL->getParameter('end'); $this->rooms = FrontendHotelsModel::getRooms($this->id, $start, $end); foreach ($this->rooms as &$room) { $room['image'] = HOTELS_API_URL . FRONTEND_FILES_URL . '/rooms/images/source/' . $room['image']; } }
private function getData() { if ($this->URL->getParameter(0) == null) { $this->record = FrontendHotelsModel::getAllRecords('hotels'); foreach ($this->record as &$hotel) { $hotel['image'] = HOTELS_API_URL . FRONTEND_FILES_URL . '/hotels/images/source/' . $hotel['image']; } } else { $this->record = FrontendHotelsModel::getRecord('hotels', $this->URL->getParameter(0)); if (empty($this->record)) { http_response_code(404); } } }