You are here

public function TBMegaMenuBuilder::loadEntityBlock in The Better Mega Menu 2.x

Same name and namespace in other branches
  1. 8 src/TBMegaMenuBuilder.php \Drupal\tb_megamenu\TBMegaMenuBuilder::loadEntityBlock()

Load blocks by block_id.

Parameters

string $block_id: The block id.

Return value

\Drupal\Core\Entity\EntityInterface|null The block entity.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides TBMegaMenuBuilderInterface::loadEntityBlock

1 call to TBMegaMenuBuilder::loadEntityBlock()
TBMegaMenuBuilder::isBlockContentEmpty in src/TBMegaMenuBuilder.php
Test if a block has content or not.

File

src/TBMegaMenuBuilder.php, line 130

Class

TBMegaMenuBuilder
Defines a TBMegaMenuBuilder.

Namespace

Drupal\tb_megamenu

Code

public function loadEntityBlock(string $block_id) {
  return $this->entityTypeManager
    ->getStorage('block')
    ->load($block_id);
}