You are here

public function BlockForm::exist in Layout Builder Browser 8

Check whether an layout_builder_browser configuration entity exists.

The id of the block to check.

Return value

bool True if block exists.

File

src/Form/BlockForm.php, line 187

Class

BlockForm
Form handler for the block add and edit forms.

Namespace

Drupal\layout_builder_browser\Form

Code

public function exist($id) {
  $entity = $this->entityTypeManager
    ->getStorage('layout_builder_browser_block')
    ->getQuery()
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}