/** * @param array|Object\ClassDefinition\Layout|Object\ClassDefinition\Data $def * @return void */ public function extractDataDefinitions($def) { if ($def instanceof Object\ClassDefinition\Layout) { if ($def->hasChilds()) { foreach ($def->getChilds() as $child) { $this->extractDataDefinitions($child); } } } if ($def instanceof Object\ClassDefinition\Data) { $this->addFieldDefinition($def->getName(), $def); } }
/** * @param array|Object\ClassDefinition\Layout|Object\ClassDefinition\Data $def * @return void */ public function extractDataDefinitions($def) { if ($def instanceof Object\ClassDefinition\Layout) { if ($def->hasChilds()) { foreach ($def->getChilds() as $child) { $this->extractDataDefinitions($child); } } } if ($def instanceof Object\ClassDefinition\Data) { $existing = $this->getFieldDefinition($def->getName()); if ($existing && method_exists($existing, "addReferencedField")) { // this is especially for localized fields which get aggregated here into one field definition // in the case that there are more than one localized fields in the class definition // see also pimcore.object.edit.addToDataFields(); $existing->addReferencedField($def); } else { $this->addFieldDefinition($def->getName(), $def); } } }