You are here

interface ShortcutSetStorageInterface in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/shortcut/src/ShortcutSetStorageInterface.php \Drupal\shortcut\ShortcutSetStorageInterface
  2. 9 core/modules/shortcut/src/ShortcutSetStorageInterface.php \Drupal\shortcut\ShortcutSetStorageInterface

Defines an interface for shortcut_set entity storage classes.

Hierarchy

Expanded class hierarchy of ShortcutSetStorageInterface

All classes that implement ShortcutSetStorageInterface

3 files declare their use of ShortcutSetStorageInterface
ShortcutSetDeleteForm.php in core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php
ShortcutSetUsers.php in core/modules/shortcut/src/Plugin/migrate/destination/ShortcutSetUsers.php
SwitchShortcutSet.php in core/modules/shortcut/src/Form/SwitchShortcutSet.php

File

core/modules/shortcut/src/ShortcutSetStorageInterface.php, line 11

Namespace

Drupal\shortcut
View source
interface ShortcutSetStorageInterface extends ConfigEntityStorageInterface {

  /**
   * Assigns a user to a particular shortcut set.
   *
   * @param \Drupal\shortcut\ShortcutSetInterface $shortcut_set
   *   An object representing the shortcut set.
   * @param $account
   *   A user account that will be assigned to use the set.
   */
  public function assignUser(ShortcutSetInterface $shortcut_set, $account);

  /**
   * Unassigns a user from any shortcut set they may have been assigned to.
   *
   * The user will go back to using whatever default set applies.
   *
   * @param $account
   *   A user account that will be removed from the shortcut set assignment.
   *
   * @return 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.
   */
  public function unassignUser($account);

  /**
   * Delete shortcut sets assigned to users.
   *
   * @param \Drupal\shortcut\ShortcutSetInterface $entity
   *   Delete the user assigned sets belonging to this shortcut.
   */
  public function deleteAssignedShortcutSets(ShortcutSetInterface $entity);

  /**
   * Get the name of the set assigned to this user.
   *
   * @param \Drupal\user\Entity\User $account
   *   The user account.
   *
   * @return string
   *   The name of the shortcut set assigned to this user.
   */
  public function getAssignedToUser($account);

  /**
   * Get the number of users who have this set assigned to them.
   *
   * @param \Drupal\shortcut\ShortcutSetInterface $shortcut_set
   *   The shortcut to count the users assigned to.
   *
   * @return int
   *   The number of users who have this set assigned to them.
   */
  public function countAssignedUsers(ShortcutSetInterface $shortcut_set);

  /**
   * Gets the default shortcut set for a given user account.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The user account whose default shortcut set will be returned.
   *
   * @return \Drupal\shortcut\ShortcutSetInterface
   *   An object representing the default shortcut set.
   */
  public function getDefaultSet(AccountInterface $account);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigEntityStorageInterface::createFromStorageRecord public function Creates a configuration entity from storage values. 1
ConfigEntityStorageInterface::getIDFromConfigName public static function Extracts the configuration entity ID from the full configuration name. 1
ConfigEntityStorageInterface::loadMultipleOverrideFree public function Loads one or more entities in their original form without overrides. 1
ConfigEntityStorageInterface::loadOverrideFree public function Loads one entity in their original form without overrides. 1
ConfigEntityStorageInterface::updateFromStorageRecord public function Updates a configuration entity from storage values. 1
EntityStorageInterface::create public function Constructs a new entity object, without permanently saving it. 1
EntityStorageInterface::delete public function Deletes permanently saved entities. 1
EntityStorageInterface::deleteRevision public function Delete a specific entity revision. 4
EntityStorageInterface::FIELD_LOAD_CURRENT constant Load the most recent version of an entity's field data.
EntityStorageInterface::FIELD_LOAD_REVISION constant Load the version of an entity's field data specified in the entity.
EntityStorageInterface::getAggregateQuery public function Gets an aggregated query instance. 1
EntityStorageInterface::getEntityClass public function Retrieves the class name used to create the entity. 1
EntityStorageInterface::getEntityType public function Gets the entity type definition. 1
EntityStorageInterface::getEntityTypeId public function Gets the entity type ID. 1
EntityStorageInterface::getQuery public function Gets an entity query instance. 1
EntityStorageInterface::hasData public function Determines if the storage contains any data. 1
EntityStorageInterface::load public function Loads one entity. 1
EntityStorageInterface::loadByProperties public function Load entities by their property values. 1
EntityStorageInterface::loadMultiple public function Loads one or more entities. 1
EntityStorageInterface::loadRevision public function Load a specific entity revision. 4
EntityStorageInterface::loadUnchanged public function Loads an unchanged entity from the database. 1
EntityStorageInterface::resetCache public function Resets the internal entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1
ShortcutSetStorageInterface::assignUser public function Assigns a user to a particular shortcut set. 1
ShortcutSetStorageInterface::countAssignedUsers public function Get the number of users who have this set assigned to them. 1
ShortcutSetStorageInterface::deleteAssignedShortcutSets public function Delete shortcut sets assigned to users. 1
ShortcutSetStorageInterface::getAssignedToUser public function Get the name of the set assigned to this user. 1
ShortcutSetStorageInterface::getDefaultSet public function Gets the default shortcut set for a given user account. 1
ShortcutSetStorageInterface::unassignUser public function Unassigns a user from any shortcut set they may have been assigned to. 1