}
}
+ $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]),
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);
- }
-
}