convert to using a civix-generated entity

This commit is contained in:
2019-08-19 17:48:04 -04:00
parent b27c080d18
commit 092cb2a184
9 changed files with 309 additions and 80 deletions

View File

@ -263,16 +263,17 @@ function _annualgrantbudgets_civix_find_files($dir, $pattern) {
*/
function _annualgrantbudgets_civix_civicrm_managed(&$entities) {
$mgdFiles = _annualgrantbudgets_civix_find_files(__DIR__, '*.mgd.php');
sort($mgdFiles);
foreach ($mgdFiles as $file) {
$es = include $file;
foreach ($es as $e) {
if (empty($e['module'])) {
$e['module'] = E::LONG_NAME;
}
$entities[] = $e;
if (empty($e['params']['version'])) {
$e['params']['version'] = '3';
}
$entities[] = $e;
}
}
}
@ -453,6 +454,14 @@ function _annualgrantbudgets_civix_civicrm_alterSettingsFolders(&$metaDataFolder
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_entityTypes
*/
function _annualgrantbudgets_civix_civicrm_entityTypes(&$entityTypes) {
$entityTypes = array_merge($entityTypes, []);
$entityTypes = array_merge($entityTypes, array (
'CRM_AnnualGrantBudgets_DAO_GrantBudget' =>
array (
'name' => 'GrantBudget',
'class' => 'CRM_AnnualGrantBudgets_DAO_GrantBudget',
'table' => 'civicrm_grant_budget',
),
));
}