-
-
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
APIv4 - Add tableName to Entity.get output #22829
Conversation
(Standard links)
|
->addDefault('html_type', 'Text') | ||
->addDefault('custom_group_id', '$id') | ||
->addRecord(['label' => 'MyField1']) | ||
) |
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.
General patch makes sense.
What's the connection between Entity::getInfo()['table_name']
and the ability to join CustomGroup::create()
to CustomField::save()
? (I would have expected that the only magic in the chain is based on the FK between CG/CF.)
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.
@totten it turns out APIv4 only bothers to create a virtual entity from a custom field set if it contains fields. Which makes sense. So this test had been testing a scenario that wouldn't fully work.
Here's a basic
This was interesting because it had realistic examples of many kinds of entities (eg core-dao, core-special, extension-dao, extension-special, custom-group). The |
Thanks for the review @totten |
Overview
Adds another useful bit of output to APIv4 Entity.get. Improves flexibility for virtual entities.
Before
Relationship between entities and tables pretty much hard-coded.
After
More flexible, each entity can decide on its table name using dynamic logic if needed.
Comments
There is massive test coverage on this.