/** * @param $object * @param null $options */ public function map($object, $options = null) { parent::map($object); $keys = get_object_vars($this); if (array_key_exists("childs", $keys)) { if ($object->hasChilds()) { $this->childs = array(); foreach ($object->getChilds() as $child) { $item = new Webservice\Data\Document\Listing\Item(); $item->id = $child->getId(); $item->type = $child->getType(); $this->childs[] = $item; } } } }
/** * @param $object * @param null $options */ public function map($object, $options = null) { parent::map($object, $options); $settings = $object->getCustomSettings(); if (!empty($settings)) { $this->customSettings = $settings; } $keys = get_object_vars($this); if (array_key_exists("childs", $keys)) { if ($object->hasChilds()) { $this->childs = []; foreach ($object->getChilds() as $child) { $item = new Webservice\Data\Asset\Listing\Item(); $item->id = $child->getId(); $item->type = $child->getType(); $this->childs[] = $item; } } } $this->metadata = $object->getMetadata(); }
/** * @param $class */ public function map($class, $options = null) { $arr = $class->fieldDefinitions; $result = []; foreach ($arr as $item) { $result[] = $item; } $class->fieldDefinitions = $item; parent::map($class); }