You are here

public function EntityDisplayBase::getComponent in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityDisplayBase.php \Drupal\Core\Entity\EntityDisplayBase::getComponent()
  2. 9 core/lib/Drupal/Core/Entity/EntityDisplayBase.php \Drupal\Core\Entity\EntityDisplayBase::getComponent()

Gets the display options set for a component.

Parameters

string $name: The name of the component.

Return value

array|null The display options for the component, or NULL if the component is not displayed.

Overrides EntityDisplayInterface::getComponent

4 calls to EntityDisplayBase::getComponent()
EntityFormDisplay::getRenderer in core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
Gets the renderer plugin for a field (e.g. widget, formatter).
EntityFormDisplay::processForm in core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
Process callback: assigns weights and hides extra fields.
EntityViewDisplay::getRenderer in core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
Gets the renderer plugin for a field (e.g. widget, formatter).
LayoutBuilderEntityViewDisplay::getComponent in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Gets the display options set for a component.
1 method overrides EntityDisplayBase::getComponent()
LayoutBuilderEntityViewDisplay::getComponent in core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php
Gets the display options set for a component.

File

core/lib/Drupal/Core/Entity/EntityDisplayBase.php, line 330

Class

EntityDisplayBase
Provides a common base class for entity view and form displays.

Namespace

Drupal\Core\Entity

Code

public function getComponent($name) {
  return $this->content[$name] ?? NULL;
}