You are here

public function ShortcutSetStorage::getAssignedToUser in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/shortcut/src/ShortcutSetStorage.php \Drupal\shortcut\ShortcutSetStorage::getAssignedToUser()

Get the name of the set assigned to this user.

Parameters

\Drupal\user\Entity\User: The user account.

Return value

string The name of the shortcut set assigned to this user.

Overrides ShortcutSetStorageInterface::getAssignedToUser

File

core/modules/shortcut/src/ShortcutSetStorage.php, line 99
Contains \Drupal\shortcut\ShortcutSetStorage.

Class

ShortcutSetStorage
Defines a storage for shortcut_set entities.

Namespace

Drupal\shortcut

Code

public function getAssignedToUser($account) {
  $query = db_select('shortcut_set_users', 'ssu');
  $query
    ->fields('ssu', array(
    'set_name',
  ));
  $query
    ->condition('ssu.uid', $account
    ->id());
  return $query
    ->execute()
    ->fetchField();
}