コード例 #1
0
 /**
  * Make a word human readable
  *
  * @param string $string The string to make human readable
  * @return string The human readable string
  */
 public function render($string = NULL)
 {
     if ($string === NULL) {
         $string = $this->renderChildren();
     }
     return $this->inflector->humanize($string);
 }
コード例 #2
0
 /**
  * @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;
 }