You are here

public function LayoutOption::getLayoutById in Bootstrap Layout Builder 2.x

Same name and namespace in other branches
  1. 1.x src/Entity/LayoutOption.php \Drupal\bootstrap_layout_builder\Entity\LayoutOption::getLayoutById()

Get layout entity by Id.

Parameters

string $layout_id: The layout id.

Return value

object The layout entity.

Overrides LayoutOptionInterface::getLayoutById

File

src/Entity/LayoutOption.php, line 200

Class

LayoutOption
Defines the layout option entity class.

Namespace

Drupal\bootstrap_layout_builder\Entity

Code

public function getLayoutById($layout_id) {
  $layout = $this
    ->entityTypeManager()
    ->getStorage('blb_layout')
    ->load($layout_id);
  return $layout;
}