function LayoutBuilderEntityViewDisplay::getComponent

Same name in other branches
  1. 8.9.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::getComponent()
  2. 10 core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::getComponent()
  3. 11.x core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::getComponent()

Overrides EntityDisplayBase::getComponent

1 call to LayoutBuilderEntityViewDisplay::getComponent()
QuickEditLayoutBuilderEntityViewDisplay::getComponent in core/modules/quickedit/src/Entity/QuickEditLayoutBuilderEntityViewDisplay.php
Gets the display options set for a component.
1 method overrides LayoutBuilderEntityViewDisplay::getComponent()
QuickEditLayoutBuilderEntityViewDisplay::getComponent in core/modules/quickedit/src/Entity/QuickEditLayoutBuilderEntityViewDisplay.php
Gets the display options set for a component.

File

core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php, line 474

Class

LayoutBuilderEntityViewDisplay
Provides an entity view display entity that has a layout.

Namespace

Drupal\layout_builder\Entity

Code

public function getComponent($name) {
    if ($this->isLayoutBuilderEnabled() && ($section_component = $this->getSectionComponentForFieldName($name))) {
        $plugin = $section_component->getPlugin();
        if ($plugin instanceof ConfigurableInterface) {
            $configuration = $plugin->getConfiguration();
            if (isset($configuration['formatter'])) {
                return $configuration['formatter'];
            }
        }
    }
    return parent::getComponent($name);
}

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