You are here

public function MegaMenuAdd::exist in The Better Mega Menu 8

Same name and namespace in other branches
  1. 2.x src/Form/MegaMenuAdd.php \Drupal\tb_megamenu\Form\MegaMenuAdd::exist()

Helper function to check whether an Example configuration entity exists.

File

src/Form/MegaMenuAdd.php, line 159

Class

MegaMenuAdd
Form handler for adding MegaMenuConfig entities.

Namespace

Drupal\tb_megamenu\Form

Code

public function exist($id) {
  $entity = $this->entityQuery
    ->get('example')
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}