public function ShortcutSetStorage::countAssignedUsers in Drupal 10
Same name and namespace in other branches
- 8 core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::countAssignedUsers()
- 9 core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::countAssignedUsers()
Get the number of users who have this set assigned to them.
Parameters
\Drupal\shortcut\ShortcutSetInterface $shortcut_set: The shortcut to count the users assigned to.
Return value
int The number of users who have this set assigned to them.
Overrides ShortcutSetStorageInterface::countAssignedUsers
File
- core/
modules/ shortcut/ src/ ShortcutSetStorage.php, line 121
Class
- ShortcutSetStorage
- Defines a storage for shortcut_set entities.
Namespace
Drupal\shortcutCode
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();
}