Additional Component Service¶
Service identity¶
- Service ID:
name.additional_component - Interface:
Drupal\name\Service\AdditionalComponentInterface - Class:
Drupal\name\Service\AdditionalComponentService - Visibility:
@internal— use field/formatter settings and formatting APIs, not direct calls from custom modules unless you extend Name internals.
Resolves preferred and alternative name data from other entity fields
when name format patterns reference those tokens (p, a, and related
conditionals).
Primary method¶
getAdditionalComponent(FieldItemListInterface $items, mixed $key_value, mixed $sep_value): string¶
$key_value— field machine name on the parent entity,_self(entity label), or_self_property:property_name.$sep_value— separator string when the source field has multiple values.- Returns rendered or label text suitable for injection into the component
array before
name.formatterruns.
Where it is used¶
- Field type —
preferred_field_referenceandalternative_field_referenceonNameItem(see Field storage settings). - Formatter plugin — display settings with the same keys for output.
- User integration —
UserHooks::userLoad()merges preferred/alternative values before formatting the accountrealname.