You are here

public function MenuPositionRuleForm::exist in Menu Position 8

Returns boolean indicating whether or not this entity exists.

Parameters

string $id: The id of the entity.

Return value

bool Whether or not the entity exists already.

File

src/Form/MenuPositionRuleForm.php, line 355

Class

MenuPositionRuleForm
The Menu Position rule form.

Namespace

Drupal\menu_position\Form

Code

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