function SwitchShortcutSet::exists

Same name in other branches
  1. 8.9.x core/modules/shortcut/src/Form/SwitchShortcutSet.php \Drupal\shortcut\Form\SwitchShortcutSet::exists()
  2. 10 core/modules/shortcut/src/Form/SwitchShortcutSet.php \Drupal\shortcut\Form\SwitchShortcutSet::exists()
  3. 11.x core/modules/shortcut/src/Form/SwitchShortcutSet.php \Drupal\shortcut\Form\SwitchShortcutSet::exists()

Determines if a shortcut set exists already.

Parameters

string $id: The set ID to check.

Return value

bool TRUE if the shortcut set exists, FALSE otherwise.

File

core/modules/shortcut/src/Form/SwitchShortcutSet.php, line 151

Class

SwitchShortcutSet
Builds the shortcut set switch form.

Namespace

Drupal\shortcut\Form

Code

public function exists($id) {
    return (bool) $this->shortcutSetStorage
        ->getQuery()
        ->condition('id', $id)
        ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.