/** * @param \EBT\ExtensionBuilder\Domain\Model\Extension $extension * @param string $type * @throws \InvalidArgumentException */ public function prepareLabelArray($extension, $type = 'locallang') { $labelArray = array(); foreach ($extension->getDomainObjects() as $domainObject) { /* @var \EBT\ExtensionBuilder\Domain\Model\DomainObject $domainObject */ $labelArray[$domainObject->getLabelNamespace()] = $this->inflector->humanize($domainObject->getName()); foreach ($domainObject->getProperties() as $property) { $labelArray[$property->getLabelNamespace()] = $this->inflector->humanize($property->getName()); } if ($type == 'locallang_db') { $tableToMapTo = $domainObject->getMapToTable(); if (!empty($tableToMapTo)) { $labelArray[$tableToMapTo . '.tx_extbase_type.' . $domainObject->getRecordType()] = $extension->getName() . ' ' . $domainObject->getName(); } if (count($domainObject->getChildObjects()) > 0) { $labelArray[$extension->getShortExtensionKey() . '.tx_extbase_type'] = 'Record Type'; $labelArray[$extension->getShortExtensionKey() . '.tx_extbase_type.0'] = 'Default'; $labelArray[$domainObject->getLabelNamespace() . '.tx_extbase_type.' . $domainObject->getRecordType()] = $extension->getName() . ' ' . $domainObject->getName(); } } } return $labelArray; }
/** * @return string */ public function getLabelNamespace() { return $this->extension->getShortExtensionKey() . '_domain_model_' . strtolower($this->getName()); }