Ejemplo n.º 1
0
 static function GetWebConfig()
 {
     API::init();
     \Debugbar::startMeasure('API: featured', 'API: featured');
     $api_response = Cache::remember('webconfig', 20, function () use($query) {
         return json_decode(self::$api->get(self::$api_url . '/web-config?access_token=' . Session::get('access_token'))->getBody(), false);
     });
     \Debugbar::stopMeasure('API: featured');
     $webconfig = $api_response->data->data[0];
     foreach (['destination', 'interest', 'poi'] as $tag_type) {
         foreach ($webconfig->{$tag_type} as $k => $tag) {
             $webconfig->{$tag_type}[$k]->tours = API::reformat_images($webconfig->{$tag_type}[$k]->tours);
             foreach ($webconfig->{$tag_type}[$k]->tours as $i => $tour) {
                 $webconfig->{$tag_type}[$k]->tours[$i]->cheapest_upcoming_schedules = Static::get_cheapest_upcoming_schedules_to_tour($tour);
             }
         }
     }
     return $webconfig;
 }