/** * @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 bool $as_string [optional] * @param string $string_format [optional] * @return \DateTime|null|string */ function getCreationTime($as_string = false, $string_format = 'Y-m-d H:i:s') { return Utils::formatDateTime($this['creation-time'], $as_string, $string_format); }
/** * @param \SimpleXMLElement $element * @return Project */ public static function createFromXML(\SimpleXMLElement $element) { /** @var Project $project */ $project = parent::createFromXML($element); if (isset($element->building)) { foreach ($element->building as $building_element) { $building = Building::createFromXML($building_element); $project->addBuilding($building); } } $project->email_headers = Utils::fetchChildAttributePairs($element, 'email-header', 'locale', 'text'); $project->emails = Utils::fetchChildAttributePairs($element, 'email', 'locale', 'text'); $project->email_footers = Utils::fetchChildAttributePairs($element, 'email-footer', 'locale', 'text'); if (isset($element->gallery)) { foreach ($element->gallery as $gallery_element) { $gallery = Gallery::createFromXML($gallery_element); $project->addGallery($gallery); } } if (isset($element->poi)) { foreach ($element->poi as $poi_element) { $poi = POI::createFromXML($poi_element); $project->addPOI($poi); } } if (isset($element->{"flat-attribute-type"})) { foreach ($element->{"flat-attribute-type"} as $flat_attribute_element) { $flat_attribute = FlatAttribute::createFromXML($flat_attribute_element); $project->addFlatAttribute($flat_attribute); } } $attributes = Utils::fetchChildAttributePairs($element, 'project-attribute', 'key', 'value'); foreach ($attributes as $attribute => $value) { $project->setParameter($attribute, $value); } return $project; }
/** * @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; }