You are here

public function FieldLayoutEntityDisplayTrait::ensureLayout in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php \Drupal\field_layout\Entity\FieldLayoutEntityDisplayTrait::ensureLayout()
1 call to FieldLayoutEntityDisplayTrait::ensureLayout()
FieldLayoutEntityDisplayTrait::init in core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php
Overrides \Drupal\Core\Entity\EntityDisplayBase::init().

File

core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php, line 128

Class

FieldLayoutEntityDisplayTrait
Provides shared code for entity displays.

Namespace

Drupal\field_layout\Entity

Code

public function ensureLayout($default_layout_id = 'layout_onecol') {
  if (!$this
    ->getLayoutId()) {
    $this
      ->setLayoutId($default_layout_id);
  }
  return $this;
}