public function EntityDisplayBase::__construct

Overrides Entity::__construct().

Overrides ConfigEntityBase::__construct

2 calls to EntityDisplayBase::__construct()
EntityDisplay::__construct in drupal/core/modules/entity/lib/Drupal/entity/Plugin/Core/Entity/EntityDisplay.php
Overrides Entity::__construct().
EntityFormDisplay::__construct in drupal/core/modules/entity/lib/Drupal/entity/Plugin/Core/Entity/EntityFormDisplay.php
Overrides Entity::__construct().
2 methods override EntityDisplayBase::__construct()
EntityDisplay::__construct in drupal/core/modules/entity/lib/Drupal/entity/Plugin/Core/Entity/EntityDisplay.php
Overrides Entity::__construct().
EntityFormDisplay::__construct in drupal/core/modules/entity/lib/Drupal/entity/Plugin/Core/Entity/EntityFormDisplay.php
Overrides Entity::__construct().

File

drupal/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php, line 92
Contains \Drupal\entity\EntityDisplayBase.

Class

EntityDisplayBase
Base class for config entity types that store configuration for entity forms and displays.

Namespace

Drupal\entity

Code

public function __construct(array $values, $entity_type) {

  // @todo See http://drupal.org/node/1825044#comment-6847792: contact.module
  // currently produces invalid entities with a NULL bundle in some cases.
  // Add the validity checks back when http://drupal.org/node/1856556 is
  // fixed.
  // if (!isset($values['targetEntityType']) || !isset($values['bundle']) || !isset($values['mode'])) {
  //   throw new \InvalidArgumentException('Missing required properties for an EntityDisplay entity.');
  // }
  // A plugin manager and a context type needs to be set by extending classes.
  if (!isset($this->pluginManager)) {
    throw new \RuntimeException('Missing plugin manager.');
  }
  if (!isset($this->displayContext)) {
    throw new \RuntimeException('Missing display context type.');
  }
  parent::__construct($values, $entity_type);
  $this->originalMode = $this->mode;
}