X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FCodeGen%2FSpecification.php;h=ed9e2f768ecd7142c271666d158bef5088b232f0;hb=d1eed91c218f4c285a535275e36732f68463824b;hp=4d2be52ad41a80a166a0a7e479ab6de497f6e767;hpb=2d4074a2a56a9e717dd6c0adb66151bda60cfa67;p=civicrm-core.git diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index 4d2be52ad4..ed9e2f768e 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -204,15 +204,18 @@ class CRM_Core_CodeGen_Specification { } } + $titleFromClass = preg_replace('/([a-z])([A-Z])/', '$1 $2', $klass); $table = [ 'name' => $name, 'base' => $daoPath, 'sourceFile' => $sourceFile, 'fileName' => $klass . '.php', 'objectName' => $klass, - 'title' => $tableXML->title ?? self::nameToTitle($klass), + 'title' => $tableXML->title ?? $titleFromClass, + 'titlePlural' => $tableXML->titlePlural ?? CRM_Utils_String::pluralize($tableXML->title ?? $titleFromClass), 'icon' => $tableXML->icon ?? NULL, 'add' => $tableXML->add ?? NULL, + 'paths' => (array) ($tableXML->paths ?? []), 'labelName' => substr($name, 8), 'className' => $this->classNames[$name], 'bao' => ($useBao ? str_replace('DAO', 'BAO', $this->classNames[$name]) : $this->classNames[$name]), @@ -746,15 +749,4 @@ class CRM_Core_CodeGen_Specification { return 'CRM_Utils_Type::HUGE'; } - /** - * Converts an entity name to a user friendly string. - * - * @param string $name - * return string - */ - public static function nameToTitle(string $name) { - $name = preg_replace('/([a-z])([A-Z])/', '$1 $2', $name); - return CRM_Utils_String::pluralize($name); - } - }