MenuForm::menuNameExists

public MenuForm::menuNameExists($value)

Returns whether a menu name already exists.

Parameters

string $value: The name of the menu.

Return value

bool Returns TRUE if the menu already exists, FALSE otherwise.

File

core/modules/menu_ui/src/MenuForm.php, line 161

Class

MenuForm
Base form for menu edit forms.

Namespace

Drupal\menu_ui

Code

public function menuNameExists($value) {
  // Check first to see if a menu with this ID exists.
  if ($this->entityQueryFactory->get('menu')->condition('id', $value)->range(0, 1)->count()->execute()) {
    return TRUE;
  }

  // Check for a link assigned to this menu.
  return $this->menuLinkManager->menuNameInUse($value);
}
doc_Drupal
2016-10-29 09:26:17
Comments
Leave a Comment

Please login to continue.