/** * Constructor * * @param string $xmlString The XML forecast data. */ public function __construct($xmlString) { parent::__construct($xmlString); foreach ($this->xml->xpath('//station') as $station) { $this->stations[] = get_object_vars($station); } }
/** * Constructor * * @param string $xmlString The XML forecast data. */ public function __construct($xmlString) { parent::__construct($xmlString); // calculate the number of days in the forecast $this->length = count($this->getStartTimes()); // array cache for days $this->days = array(); }