interface EntityDisplayWithLayoutInterface

Same name and namespace in other branches
  1. 11.x core/modules/field_layout/src/Display/EntityDisplayWithLayoutInterface.php \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface

Provides a common interface for entity displays that have layout.

Hierarchy

Expanded class hierarchy of EntityDisplayWithLayoutInterface

All classes that implement EntityDisplayWithLayoutInterface

7 files declare their use of EntityDisplayWithLayoutInterface
FieldLayoutBuilder.php in core/modules/field_layout/src/FieldLayoutBuilder.php
FieldLayoutBuilderTest.php in core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
FieldLayoutEntityDisplayFormTrait.php in core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php
FieldLayoutEntityFormDisplay.php in core/modules/field_layout/src/Entity/FieldLayoutEntityFormDisplay.php
FieldLayoutEntityViewDisplay.php in core/modules/field_layout/src/Entity/FieldLayoutEntityViewDisplay.php

... See full list

File

core/modules/field_layout/src/Display/EntityDisplayWithLayoutInterface.php, line 11

Namespace

Drupal\field_layout\Display
View source
interface EntityDisplayWithLayoutInterface extends EntityDisplayInterface {
  
  /**
   * Gets the default region.
   *
   * @return string
   *   The default region for this display.
   */
  public function getDefaultRegion();
  
  /**
   * Gets the layout plugin ID for this display.
   *
   * @return string
   *   The layout plugin ID.
   */
  public function getLayoutId();
  
  /**
   * Gets the layout plugin settings for this display.
   *
   * @return mixed[]
   *   The layout plugin settings.
   */
  public function getLayoutSettings();
  
  /**
   * Sets the layout plugin ID for this display.
   *
   * @param string|null $layout_id
   *   Either a valid layout plugin ID, or NULL to remove the layout setting.
   * @param array $layout_settings
   *   (optional) An array of settings for this layout.
   *
   * @return $this
   */
  public function setLayoutId($layout_id, array $layout_settings = []);
  
  /**
   * Sets the layout plugin for this display.
   *
   * @param \Drupal\Core\Layout\LayoutInterface $layout
   *   A layout plugin.
   *
   * @return $this
   */
  public function setLayout(LayoutInterface $layout);
  
  /**
   * Gets the layout plugin for this display.
   *
   * @return \Drupal\Core\Layout\LayoutInterface
   *   The layout plugin.
   */
  public function getLayout();
  
  /**
   * Ensures this entity has a layout.
   *
   * @param string $default_layout_id
   *   (optional) The layout ID to use as a default. Defaults to
   *   'layout_onecol'.
   *
   * @return $this
   */
  public function ensureLayout($default_layout_id = 'layout_onecol');

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.