function EntityViewDisplay::getPluginCollections

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php \Drupal\Core\Entity\Entity\EntityViewDisplay::getPluginCollections()
  2. 10 core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php \Drupal\Core\Entity\Entity\EntityViewDisplay::getPluginCollections()
  3. 11.x core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php \Drupal\Core\Entity\Entity\EntityViewDisplay::getPluginCollections()

File

core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php, line 295

Class

EntityViewDisplay
Configuration entity.

Namespace

Drupal\Core\Entity\Entity

Code

public function getPluginCollections() {
    $configurations = [];
    foreach ($this->getComponents() as $field_name => $configuration) {
        if (!empty($configuration['type']) && ($field_definition = $this->getFieldDefinition($field_name))) {
            $configurations[$configuration['type']] = $configuration + [
                'field_definition' => $field_definition,
                'view_mode' => $this->originalMode,
            ];
        }
    }
    return [
        'formatters' => new EntityDisplayPluginCollection($this->pluginManager, $configurations),
    ];
}

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