- Issue created by @neclimdul
- πΊπΈUnited States dww
I was in the Slack thread (attached with permission) where this was discussed. We're all in favor. Thanks for opening the issue!
When interacting with a Reference field there is no explicit way to get the related entity. For example a referenced node or taxonomy term.
Additionally, at least in phpstorm, the magic getter method retrieving a referenced entity looks to the IDE like its connected to the parent entity property on DataType\EntityAdapter
This is simplified but in some code interacting with a taxonomy term do something like this.
$tag = $node->get('field_tags')->first();
if ($tag) {
// This entity gives you the referenced entity but triggers and IDE warning and is unclear what you're interacting with.
$term = $tag->entity;
}
Provide a method named something like getReferencedEntity
on EntityReferenceItem
or EntityReferenceItemBase
to improve the usability of interacting with the referenced entities and entity reference fields.
see π ResourceTypeRepository wrongly assumes that all entity reference fields have the setting "target_type" Fixed for a similar discussion on this.
This will likely require a new interface or changes to the existing interface.
Active
11.0 π₯
I was in the Slack thread (attached with permission) where this was discussed. We're all in favor. Thanks for opening the issue!