Implements UnboundDisplayInterface::generateDisplay().
\Exception
Overrides UnboundDisplayInterface::generateDisplay
public function generateDisplay(LayoutInterface $layout, $id, $entity_type = 'display') {
$values = array(
'layout' => $layout
->getPluginId(),
'blockInfo' => $this
->mapBlocksToLayout($layout),
'id' => $id,
);
$entity = entity_create($entity_type, $values);
if (!$entity instanceof BoundDisplayInterface) {
throw new \Exception(sprintf('Attempted to bind an unbound display but provided an invalid entity type.'), E_RECOVERABLE_ERROR);
}
return $entity;
}