encryption = $encryption; } /** * @OA\Get( * path="/SAVVY/geofencearea/api/populardestinations?city={city_id}&country={country_code}", * security={{"token": {}}}, * summary="Get list of popular destinations by city id and country code", * @OA\Response( * response="200", * description="city list", * @OA\JsonContent( * type="object" * ) * ) * ) */ public function indexAction() { $message = 'No popular destinations found'; $city = $this->requestParams['city'] ?? 0; $country = $this->requestParams['country'] ?? ''; try { if ($city<1) { throw new Exception("Invalid city"); } if ($country!='SG') { throw new Exception("Invalid country"); } $db = new Db(); list($res, $err) = PopularDestinations::get( $db->getConnect(), $country, $city ); return $this->response( [ "destinations" => $res, "error" => $err ], 200 ); } catch (Exception $e) { $message = $e->getMessage(); } return $this->response( [ "destinations" => NULL, "error" => $message ], 404); } public function viewAction() { } public function createAction() { } public function updateAction() { } public function deleteAction() { } }