function ShortcutSetStorage::countAssignedUsers

Same name and namespace in other branches
  1. 9 core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::countAssignedUsers()
  2. 8.9.x core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::countAssignedUsers()
  3. 10 core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::countAssignedUsers()

Overrides ShortcutSetStorageInterface::countAssignedUsers

File

core/modules/shortcut/src/ShortcutSetStorage.php, line 140

Class

ShortcutSetStorage
Defines a storage for shortcut_set entities.

Namespace

Drupal\shortcut

Code

public function countAssignedUsers(ShortcutSetInterface $shortcut_set) {
    return Database::getConnection()->query('SELECT COUNT(*) FROM {shortcut_set_users} WHERE [set_name] = :name', [
        ':name' => $shortcut_set->id(),
    ])
        ->fetchField();
}

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