'label' => $contactTypes[$entityName]['label'],
];
}
- $info = ("\Civi\Api4\\{$entityName}")::getInfo();
+ $info = \Civi\Api4\Entity::get(FALSE)
+ ->addWhere('name', '=', $entityName)
+ ->addSelect('title', 'icon')
+ ->execute()->first();
return [
'entity' => $entityName,
'label' => $info['title'],
}
$customApi = CustomGroup::get()
->setCheckPermissions(FALSE)
- ->setSelect(['name', 'title', 'help_pre', 'help_post'])
+ ->setSelect(['name', 'title', 'help_pre', 'help_post', 'extends'])
->addWhere('is_multiple', '=', 1)
->addWhere('is_active', '=', 1);
if ($groupNames) {
}
$item = [
'name' => $name,
+ 'type' => 'block',
'requires' => [],
'title' => ts('%1 block (default)', [1 => $custom['title']]),
'description' => '',
'is_public' => FALSE,
'permission' => 'access CiviCRM',
'join' => 'Custom_' . $custom['name'],
- 'extends' => 'Contact',
+ 'block' => $custom['extends'],
'repeat' => TRUE,
'has_base' => TRUE,
];