W3cubDocs

/Drupal 8

public function EntityDisplayBase::removeComponent

public EntityDisplayBase::removeComponent($name)

Sets a component to be hidden.

Parameters

string $name: The name of the component.

Return value

$this

Overrides EntityDisplayInterface::removeComponent

File

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

Class

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

Namespace

Drupal\Core\Entity

Code

public function removeComponent($name) {
  $this->hidden[$name] = TRUE;
  unset($this->content[$name]);
  unset($this->plugins[$name]);

  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityDisplayBase.php/function/EntityDisplayBase::removeComponent/8.1.x