public function import(\SimpleXMLElement $sx) { if (isset($sx->gatheringitemtemplates)) { foreach ($sx->gatheringitemtemplates->gatheringitemtemplate as $at) { $pkg = static::getPackageObject($at['package']); $type = Type::getByHandle((string) $at['type']); $gatHasCustomClass = false; $gatForceDefault = false; $gatFixedSlotWidth = 0; $gatFixedSlotHeight = 0; if ($at['has-custom-class']) { $gatHasCustomClass = true; } if ($at['force-default']) { $gatForceDefault = true; } if ($at['fixed-slot-width']) { $gatFixedSlotWidth = (string) $at['fixed-slot-width']; } if ($at['fixed-slot-height']) { $gatFixedSlotHeight = (string) $at['fixed-slot-height']; } $template = Template::add($type, (string) $at['handle'], (string) $at['name'], $gatFixedSlotWidth, $gatFixedSlotHeight, $gatHasCustomClass, $gatForceDefault, $pkg); foreach ($at->children() as $fe) { $feo = Feature::getByHandle((string) $fe['handle']); if (is_object($feo)) { $template->addGatheringItemTemplateFeature($feo); } } } } }
public function getBlockTypeFeatureObjects() { if (!isset($this->btFeatureObjects)) { $this->btFeatureObjects = array(); foreach ($this->btFeatures as $feHandle) { $fe = Feature::getByHandle($feHandle); if (is_object($fe)) { $this->btFeatureObjects[] = $fe; } } } return $this->btFeatureObjects; }