'paths' => static::getEntityPaths(),
'class' => static::class,
'id_field' => 'id',
+ // Entities without a @searchable annotation will default to secondary,
+ // which makes them visible in SearchKit but not at the top of the list.
+ 'searchable' => 'secondary',
];
// Add info for entities with a corresponding DAO
$dao = \CRM_Core_DAO_AllCoreTables::getFullName($info['name']);
foreach (ReflectionUtils::getTraits(static::class) as $trait) {
$info['type'][] = self::stripNamespace($trait);
}
- // Entities without a @searchable annotation will default to secondary,
- // which makes them visible in SearchKit but not at the top of the list.
- $info['searchable'] = 'secondary';
$reflection = new \ReflectionClass(static::class);
$info = array_merge($info, ReflectionUtils::getCodeDocs($reflection, NULL, ['entity' => $info['name']]));
+ if ($dao) {
+ $info['description'] = $dao::getEntityDescription() ?? $info['description'] ?? NULL;
+ }
unset($info['package'], $info['method']);
return $info;
}