Merge pull request #18748 from eileenmcnaughton/log
[civicrm-core.git] / CRM / Core / CodeGen / Specification.php
index 4d2be52ad41a80a166a0a7e479ab6de497f6e767..ed9e2f768ecd7142c271666d158bef5088b232f0 100644 (file)
@@ -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);
-  }
-
 }