/** * Loads EventData from simple xml object * * @param \SimpleXMLElement $sxml * @return EventData Returns EventData */ protected function _loadEventData(\SimpleXMLElement $sxml) { $item = null; if ($this->exist($sxml)) { $item = new EventData(); $item->setRds($this->rds); $item->date = new DateTime((string) $sxml->Date, new DateTimeZone('UTC')); $item->message = (string) $sxml->Message; $item->sourceIdentifier = $this->exist($sxml->SourceIdentifier) ? (string) $sxml->SourceIdentifier : null; $item->sourceType = $this->exist($sxml->SourceType) ? (string) $sxml->SourceType : null; if (!empty($sxml->EventCategories->EventCategory)) { $item->eventCategories = array(); foreach ($sxml->EventCategories->EventCategory as $v) { $item->eventCategories[] = (string) $v; } } } return $item; }