Skip to content
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

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Dec 3, 2020

Overview

These are the core changes needed toward getting joins supported by Search Kit

Before

Less metadata

After

More metadata

…eneral

These are the core changes needed toward geting joins supported by Search Kit
@civibot
Copy link

civibot bot commented Dec 3, 2020

(Standard links)

@civibot civibot bot added the 5.33 label Dec 3, 2020
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);
Copy link
Member

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).

Copy link
Member Author

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
Copy link
Member

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.

Copy link
Member Author

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()

@eileenmcnaughton
Copy link
Contributor

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

@eileenmcnaughton
Copy link
Contributor

This touches on the v4 api & minor metadata changes - both or which have good testing. Seems sensible, merging

@eileenmcnaughton eileenmcnaughton merged commit d13a7fc into civicrm:5.33 Dec 4, 2020
@eileenmcnaughton eileenmcnaughton deleted the searchJoins branch December 4, 2020 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants