public function UnboundDisplayInterface::generateDisplay

Returns a bound display entity by binding a layout to this unbound display.

This will DisplayInterface::mapBlocksToLayout() using the provided layout, then create and return a new Display object with the output. This is just a factory - calling code is responsible for saving the returned object.

Parameters

\Drupal\layout\Plugin\LayoutInterface $layout: The desired layout.

string $id: The entity id to assign to the newly created entity.

string $entity_type: The type of entity to create. The PHP class for this entity type must implement \Drupal\layout\Config\BoundDisplayInterface.

Return value

\Drupal\layout\Config\BoundDisplayInterface The newly created entity.

1 method overrides UnboundDisplayInterface::generateDisplay()
UnboundDisplay::generateDisplay in drupal/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/UnboundDisplay.php
Implements UnboundDisplayInterface::generateDisplay().

File

drupal/core/modules/layout/lib/Drupal/layout/Config/UnboundDisplayInterface.php, line 45
Definition of Drupal\layout\Config\UnboundDisplayInterface

Class

UnboundDisplayInterface
Interface for a Display that is not coupled with any layout.

Namespace

Drupal\layout\Config

Code

public function generateDisplay(LayoutInterface $layout, $id, $entity_type = 'display');