/** * @param \SimpleXMLElement $element * @return Picture */ public static function createFromXML(\SimpleXMLElement $element) { /** @var Picture $picture */ $picture = parent::createFromXML($element); $names = Utils::fetchChildAttributePairs($element, 'name', 'locale', 'text'); $picture->setNames($names); return $picture; }
/** * @param \SimpleXMLElement $element * @return LeadsList */ public static function createFromXML(\SimpleXMLElement $element) { /** @var LeadsList $list */ $list = parent::createFromXML($element); $states = Utils::fetchChildAttributePairs($element, 'lead', 'id', 'status'); $list->setLeadsStates($states); return $list; }
/** * @param \SimpleXMLElement $element * @return Building */ public static function createFromXML(\SimpleXMLElement $element) { /** @var Building $building */ $building = parent::createFromXML($element); if (isset($element->floor)) { foreach ($element->floor as $floor_element) { $floor = Floor::createFromXML($floor_element); $building->addFloor($floor); } } $attributes = Utils::fetchChildAttributePairs($element, 'building-attribute', 'key', 'value'); foreach ($attributes as $attribute => $value) { $building->setParameter($attribute, $value); } return $building; }
/** * @param \SimpleXMLElement $element * @return FlatAttribute */ public static function createFromXML(\SimpleXMLElement $element) { /** @var FlatAttribute $flat_attribute */ $flat_attribute = parent::createFromXML($element); $names = Utils::fetchChildAttributePairs($element, 'name', 'locale', 'text'); $flat_attribute->setNames($names); if (isset($element->enum)) { foreach ($element->enum as $enum_element) { $labels = Utils::fetchChildAttributePairs($enum_element, 'label', 'locale', 'text'); $value = Utils::formatValueFromXML((string) $enum_element['value']); $flat_attribute->addValueOption($labels, $value); } } return $flat_attribute; }
/** * @param \SimpleXMLElement $element * @return Floor */ public static function createFromXML(\SimpleXMLElement $element) { /** @var Floor $floor */ $floor = parent::createFromXML($element); if (isset($element->flat)) { foreach ($element->flat as $flat_element) { $flat = Flat::createFromXML($flat_element); $floor->addFlat($flat); } } $attributes = Utils::fetchChildAttributePairs($element, 'floor-attribute', 'key', 'value'); foreach ($attributes as $attribute => $value) { $floor->setParameter($attribute, $value); } return $floor; }
/** * @param \SimpleXMLElement $element * @return Gallery */ public static function createFromXML(\SimpleXMLElement $element) { /** @var Gallery $gallery */ $gallery = parent::createFromXML($element); if (isset($element->picture)) { foreach ($element->picture as $picture_element) { $picture = Picture::createFromXML($picture_element); $gallery->addPicture($picture); } } $gallery->names = Utils::fetchChildAttributePairs($element, 'name', 'locale', 'text'); return $gallery; }
/** * @param \SimpleXMLElement $element * @return ProjectSimple */ public static function createFromXML(\SimpleXMLElement $element) { /** @var ProjectSimple $project */ $project = parent::createFromXML($element); $locales = Utils::fetchChildAttributePairs($element, 'locale', 'iso', 'name'); $project->setLocales($locales); $descriptions = Utils::fetchChildAttributePairs($element, 'description', 'locale', 'text'); $project->setdescriptions($descriptions); return $project; }
/** * @param \SimpleXMLElement $element * @return Flat */ public static function createFromXML(\SimpleXMLElement $element) { /** @var Flat $flat */ $flat = parent::createFromXML($element); if (isset($element->picture)) { foreach ($element->picture as $picture_element) { $picture = Picture::createFromXML($picture_element); $flat->addPicture($picture); } } $attributes = Utils::fetchChildAttributePairs($element, 'flat-attribute', 'key', 'value'); foreach ($attributes as $attribute => $value) { $flat->setParameter($attribute, $value); } return $flat; }