function EntityFieldManager::getExtraFields

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getExtraFields()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getExtraFields()
  3. 10 core/lib/Drupal/Core/Entity/EntityFieldManager.php \Drupal\Core\Entity\EntityFieldManager::getExtraFields()

Overrides EntityFieldManagerInterface::getExtraFields

File

core/lib/Drupal/Core/Entity/EntityFieldManager.php, line 648

Class

EntityFieldManager
Manages the discovery of entity fields.

Namespace

Drupal\Core\Entity

Code

public function getExtraFields($entity_type_id, $bundle) {
    $this->extraFields ??= $this->loadExtraFields();
    // Read from the "static" cache.
    // Return an empty fallback if the bundle has no extra fields.
    return $this->extraFields[$entity_type_id][$bundle] ?? [
        'form' => [],
        'display' => [],
    ];
}

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