function EntityFieldManagerInterface::getFieldLabels

Returns the labels used for a field on an entity type.

Parameters

string $entity_type: The entity type.

string $field_name: The machine name of the field.

Return value

array An array where the first element is the most commonly used label for the field and the second element is a list of all labels in use. When more than one label is used the same number of times then the labels are sorted alphabetically.

1 method overrides EntityFieldManagerInterface::getFieldLabels()
EntityFieldManager::getFieldLabels in core/lib/Drupal/Core/Entity/EntityFieldManager.php
Returns the labels used for a field on an entity type.

File

core/lib/Drupal/Core/Entity/EntityFieldManagerInterface.php, line 157

Class

EntityFieldManagerInterface
Provides an interface for an entity field manager.

Namespace

Drupal\Core\Entity

Code

public function getFieldLabels(string $entity_type, string $field_name) : array;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.