getRawWeatherHistory() public method

Directly returns the xml/json/html string returned by OpenWeatherMap for the weather history.
public getRawWeatherHistory ( array | integer | string $query, DateTime $start, DateTime | integer $endOrCount = 1, string $type = 'hour', string $units = 'imperial', string $lang = 'en', string $appid = '' ) : string
$query array | integer | string The place to get weather information for. For possible values see ::getWeather.
$start DateTime The \DateTime object of the date to get the first weather information from.
$endOrCount DateTime | integer Can be either a \DateTime object representing the end of the period to receive weather history data for or an integer counting the number of reports requested.
$type string The period of the weather history requested. Can be either be either "tick", "hour" or "day".
$units string Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
$lang string The language to use for descriptions, default is 'en'. For possible values see http://openweathermap.org/current#multi.
$appid string Your app id, default ''. See http://openweathermap.org/appid for more details.
return string Returns false on failure and the fetched data in the format you specified on success. Warning If an error occurred, OpenWeatherMap ALWAYS returns data in json format.
コード例 #1
0
 /**
  * Directly returns the xml/json/html string returned by OpenWeatherMap for the daily forecast.
  *
  * @param array|int|string $query           The place to get weather information for. For possible values see below.
  * @param \DateTime        $start           The \DateTime object of the date to get the first weather information from.
  * @param \DateTime|int    $endOrCount      Can be either a \DateTime object representing the end of the period to
  *                                          receive weather history data for or an integer counting the number of
  *                                          reports requested.
  * @param string           $type            The period of the weather history requested. Can be either be either "tick",
  *                                          "hour" or "day".
  * @param string           $units           Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
  * @param string           $lang            The language to use for descriptions, default is 'en'. For possible values see below.
  * @return string
  */
 public function getRawWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = null, $lang = null)
 {
     return $this->service->getRawWeatherHistory($query, $start, $endOrCount, $type, empty($units) ? $this->units : $units, empty($lang) ? $this->lang : $lang, $this->api_key);
 }