-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve APIv4 metadata for RelationshipCache and Bridge entities in general #19101
Conversation
…eneral These are the core changes needed toward geting joins supported by Search Kit
(Standard links)
|
return static::getEntityName(); | ||
$name = static::getEntityName(); | ||
$dao = \CRM_Core_DAO_AllCoreTables::getFullName($name); | ||
return $dao ? $dao::getEntityTitle($plural) : ($plural ? \CRM_Utils_String::pluralize($name) : $name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if I'm reading correctly, this is an overall reduction in the number of functions, and it works because CRM_Core_DAO_AllCoreTables::getFullName
is fairly gentle about errors (ie returns NULL
for unrecognized/non-DAO entities).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I moved it here because the RelationshipCache
entity does not extend DAOEntity
. Ditto for the getInfo
function.
* @see \Civi\Api4\Group | ||
* | ||
* @searchable false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't noticed this before -- so does this mean that metadata can be declared in different places (xml/schema
vs class-annotations) -- and it'll get merged together for purposes getFields
(etc)? That's pretty neat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes any annotation on an APIv4 entity class will get passed through to Api4\Entity::get()
Just noting this is against the rc - but less than 24 hours since it was cut & it feels more consistent for it to be in the rc |
This touches on the v4 api & minor metadata changes - both or which have good testing. Seems sensible, merging |
Overview
These are the core changes needed toward getting joins supported by Search Kit
Before
Less metadata
After
More metadata