public function MongodbShortcutSetStorage::unassignUser in MongoDB 8
Unassigns a user from any shortcut set they may have been assigned to.
The user will go back to using whatever default set applies.
Parameters
$account: A user account that will be removed from the shortcut set assignment.
Return value
bool TRUE if the user was previously assigned to a shortcut set and has been successfully removed from it. FALSE if the user was already not assigned to any set.
Overrides ShortcutSetStorageInterface::unassignUser
File
- mongodb_shortcut/
src/ MongodbShortcutSetStorage.php, line 88 - Contains \Drupal\mongodb_shortcut\MongodbShortcutSetStorage.
Class
Namespace
Drupal\mongodb_shortcutCode
public function unassignUser($account) {
$this->mongo
->get('shortcut_set_users')
->remove([
'_id' => $account
->id(),
]);
}