public function getRawWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '')
    {
        if (!in_array($type, array('tick', 'hour', 'day'))) {
            throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"');
        }

        $url = $this->buildUrl($query, $units, $lang, $appid, 'json', $this->weatherHistoryUrl);
        $url .= "&type=$type&start={$start->format('U')}";
        if ($endOrCount instanceof \DateTime) {
            $url .= "&end={$endOrCount->format('U')}";
        } elseif (is_numeric($endOrCount) && $endOrCount > 0) {
            $url .= "&cnt=$endOrCount";
        } else {
            throw new \InvalidArgumentException('$endOrCount must be either a \DateTime or a positive integer.');
        }

        return $this->cacheOrFetchResult($url);
    }
public function getRawWeatherHistory($query, \DateTime $start, $endOrCount = 1, $type = 'hour', $units = 'imperial', $lang = 'en', $appid = '')
    {
        if (!in_array($type, array('tick', 'hour', 'day'))) {
            throw new \InvalidArgumentException('$type must be either "tick", "hour" or "day"');
        }

        $url = $this->buildUrl($query, $units, $lang, $appid, 'json', $this->weatherHistoryUrl);
        $url .= "&type=$type&start={$start->format('U')}";
        if ($endOrCount instanceof \DateTime) {
            $url .= "&end={$endOrCount->format('U')}";
        } elseif (is_numeric($endOrCount) && $endOrCount > 0) {
            $url .= "&cnt=$endOrCount";
        } else {
            throw new \InvalidArgumentException('$endOrCount must be either a \DateTime or a positive integer.');
        }

        return $this->cacheOrFetchResult($url);
    }
public function getRawWeatherHistory ( $ query , \ DateTime $ start , $ endOrCount = 1 , $ type = 'hour' , $ units = 'imperial' , $ lang = 'en' , $ appid = '' ) { if ( ! in_array ( $ type , array ( 'tick' , 'hour' , 'day' ) ) ) { throw new \ InvalidArgumentException ( '$type must be either "tick", "hour" or "day"' ) ; } $ url = $ this -> buildUrl ( $ query , $ units , $ lang , $ appid , 'json' , $ this -> weatherHistoryUrl ) ; $ url .= "&type=$type&start={$start->format('U')}" ; if ( $ endOrCount instanceof \ DateTime ) { $ url .= "&end={$endOrCount->format('U')}" ; } elseif ( is_numeric ( $ endOrCount ) && $ endOrCount > 0 ) { $ url .= "&cnt=$endOrCount" ; } else { throw new \ InvalidArgumentException ( '$endOrCount must be either a \DateTime or a positive integer.' ) ; } return $ this -> cacheOrFetchResult ( $ url ) ; }
Directly returns the json string returned by OpenWeatherMap for the weather history.

@param array|int|string $query      The place to get weather information for. For possible values see ::getWeather.
@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 http://openweathermap.org/current#multi.
@param string           $appid      Your app id, default ''. See http://openweathermap.org/appid for more details.

@throws \InvalidArgumentException

@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.

@api
Directly returns the json string returned by OpenWeatherMap for the weather history .