/** * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement * $xmlElement) * @return CultureFeed_Cdb_Data_Location */ public static function parseFromCdbXml(SimpleXMLElement $xmlElement) { if (empty($xmlElement->address)) { throw new CultureFeed_Cdb_ParseException("Address missing for location element"); } $address = CultureFeed_Cdb_Data_Address::parseFromCdbXml($xmlElement->address); $location = new CultureFeed_Cdb_Data_Location($address); if (!empty($xmlElement->label)) { $attributes = $xmlElement->label->attributes(); $location->setLabel((string) $xmlElement->label); if (isset($attributes['cdbid'])) { $location->setCdbid((string) $attributes['cdbid']); } } if (!empty($xmlElement->actor)) { $actor = CultureFeed_Cdb_Item_Actor::parseFromCdbXml($xmlElement->actor); $location->setActor($actor); } return $location; }
/** * @param \CultureFeed_Cdb_Data_Organiser|\CultureFeed_Cdb_Data_Location $item * @throws \EgoCore\Error\Exception */ private function completeActor($item) { if ($item && !$item->getActor() && ($actorCdbId = $item->getCdbid())) { if (isset($actorCache[$actorCdbId])) { $actor = $actorCache[$actorCdbId]; } else { if ($actor = $this->getActor($actorCdbId)) { $actorCache[$actorCdbId] = $actor; } } if ($actor) { $item->setActor($actor); } } }