3 * OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
7 * Please see the LICENSE file distributed with this source code for further
8 * information regarding copyright and licensing.
10 * Please visit the following links to read about the usage policies and the license of
11 * OpenWeatherMap before using this class:
13 * @see http://www.OpenWeatherMap.org
14 * @see http://www.OpenWeatherMap.org/terms
15 * @see http://openweathermap.org/appid
18 namespace Cmfcmf\OpenWeatherMap\Util;
21 * The city class representing a city object.
26 * @var int The city id.
31 * @var string The name of the city.
36 * @var float The longitude of the city.
41 * @var float The latitude of the city.
46 * @var string The abbreviation of the country the city is located in.
51 * @var int The city's population
56 * Create a new city object.
58 * @param int $id The city id.
59 * @param string $name The name of the city.
60 * @param float $lon The longitude of the city.
61 * @param float $lat The latitude of the city.
62 * @param string $country The abbreviation of the country the city is located in
63 * @param int $population The city's population.
67 public function __construct($id, $name = null, $lon = null, $lat = null, $country = null, $population = null)
70 $this->name = isset($name) ? (string)$name : null;
71 $this->lon = isset($lon) ? (float)$lon : null;
72 $this->lat = isset($lat) ? (float)$lat : null;
73 $this->country = isset($country) ? (string)$country : null;
74 $this->population = isset($population) ? (int)$population : null;