function ShortcutSetStorage::unassignUser
Same name in other branches
- 9 core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::unassignUser()
- 8.9.x core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::unassignUser()
- 11.x core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::unassignUser()
Overrides ShortcutSetStorageInterface::unassignUser
File
-
core/
modules/ shortcut/ src/ ShortcutSetStorage.php, line 105
Class
- ShortcutSetStorage
- Defines a storage for shortcut_set entities.
Namespace
Drupal\shortcutCode
public function unassignUser($account) {
$current_shortcut_set = $this->getDisplayedToUser($account);
$deleted = $this->connection
->delete('shortcut_set_users')
->condition('uid', $account->id())
->execute();
if ($current_shortcut_set instanceof ShortcutSetInterface) {
Cache::invalidateTags($current_shortcut_set->getCacheTagsToInvalidate());
}
return (bool) $deleted;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.