Implements BoundDisplayInterface::generateUnboundDisplay().
\Exception
Overrides BoundDisplayInterface::generateUnboundDisplay
public function generateUnboundDisplay($id, $entity_type = 'unbound_display') {
$block_info = $this
->getAllBlockInfo();
foreach ($block_info as &$info) {
unset($info['region']);
}
$values = array(
'blockInfo' => $block_info,
'id' => $id,
);
$entity = entity_create($entity_type, $values);
if (!$entity instanceof UnboundDisplayInterface) {
throw new \Exception(sprintf('Attempted to create an unbound display using an invalid entity type.'), E_RECOVERABLE_ERROR);
}
return $entity;
}