Example #1
0
 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);
         }
     }
 }