Overrides Entity::__construct().
Overrides ConfigEntityBase::__construct
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;
}