function EntityManager::getExtraFields

Gets the "extra fields" for a bundle.

Parameters

string $entity_type_id: The entity type ID.

string $bundle: The bundle name.

Return value

array A nested array of 'pseudo-field' elements. Each list is nested within the following keys: entity type, bundle name, context (either 'form' or 'display'). The keys are the name of the elements as appearing in the renderable array (either the entity form or the displayed entity). The value is an associative array:

  • label: The human readable name of the element. Make sure you sanitize this appropriately.
  • description: A short description of the element contents.
  • weight: The default weight of the element.
  • visible: (optional) The default visibility of the element. Defaults to TRUE.
  • edit: (optional) String containing markup (normally a link) used as the element's 'edit' operation in the administration interface. Only for 'form' context.
  • delete: (optional) String containing markup (normally a link) used as the element's 'delete' operation in the administration interface. Only for 'form' context.

Overrides EntityFieldManagerInterface::getExtraFields

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Entity\EntityFieldManagerInterface::getExtraFields() instead.

See also

https://www.drupal.org/node/2549139

File

core/lib/Drupal/Core/Entity/EntityManager.php, line 385

Class

EntityManager
Provides a wrapper around many other services relating to entities.

Namespace

Drupal\Core\Entity

Code

public function getExtraFields($entity_type_id, $bundle) {
  @trigger_error('EntityManagerInterface::getExtraFields() is deprecated in drupal:8.0.0 and will be removed before drupal:9.0.0. Use \\Drupal\\Core\\Entity\\EntityFieldManagerInterface::getExtraFields() instead. See https://www.drupal.org/node/2549139.', E_USER_DEPRECATED);
  return $this->container
    ->get('entity_field.manager')
    ->getExtraFields($entity_type_id, $bundle);
}

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