You are here

private function CheeseburgerMenu::getBlockMachineName in Cheeseburger Menu 8.4

Returns block machine name.

1 call to CheeseburgerMenu::getBlockMachineName()
CheeseburgerMenu::build in src/Plugin/Block/CheeseburgerMenu.php
Building block.

File

src/Plugin/Block/CheeseburgerMenu.php, line 501
Cheeseburger class extends BlockBase.

Class

CheeseburgerMenu
Block info.

Namespace

Drupal\cheeseburger_menu\Plugin\Block

Code

private function getBlockMachineName() {
  if (isset($this->configuration['block_machine_name'])) {
    return $this->configuration['block_machine_name'];
  }
  $blocks = $this->entityTypeManager
    ->getStorage('block')
    ->loadByProperties([
    'plugin' => $this
      ->getBaseId(),
  ]);
  foreach ($blocks as $block) {
    if ($block
      ->get('settings') == $this->configuration) {
      return $block
        ->getOriginalId();
    }
  }
  return FALSE;
}