You are here

public function MegaMenuAdd::exist in The Better Mega Menu 2.x

Same name and namespace in other branches
  1. 8 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;
}