You are here

interface GroupRoleStorageInterface in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Storage/GroupRoleStorageInterface.php \Drupal\group\Entity\Storage\GroupRoleStorageInterface

Defines an interface for group role entity storage classes.

Hierarchy

Expanded class hierarchy of GroupRoleStorageInterface

All classes that implement GroupRoleStorageInterface

File

src/Entity/Storage/GroupRoleStorageInterface.php, line 13

Namespace

Drupal\group\Entity\Storage
View source
interface GroupRoleStorageInterface extends ConfigEntityStorageInterface {

  /**
   * Retrieves all GroupRole entities for a user within a group.
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The account to load the group role entities for.
   * @param \Drupal\group\Entity\GroupInterface $group
   *   The group entity to find the user's role entities in.
   * @param boolean $include_implied
   *   (optional) Whether to include the implied roles 'anonymous', 'outsider'
   *   and 'member'. Defaults to TRUE.
   *
   * @return \Drupal\group\Entity\GroupRoleInterface[]
   *   The group roles matching the criteria.
   */
  public function loadByUserAndGroup(AccountInterface $account, GroupInterface $group, $include_implied = TRUE);

  /**
   * Retrieves all synchronized GroupRole entities by group types.
   *
   * @param string[] $group_type_ids
   *   The list of group type IDs to load the synchronized group roles for.
   *
   * @return \Drupal\group\Entity\GroupRoleInterface[]
   *   The group roles matching the group types.
   */
  public function loadSynchronizedByGroupTypes(array $group_type_ids);

  /**
   * Retrieves all synchronized GroupRole entities by user roles.
   *
   * @param string[] $role_ids
   *   The list of user role IDs to load the synchronized group roles for.
   *
   * @return \Drupal\group\Entity\GroupRoleInterface[]
   *   The group roles matching the user roles.
   */
  public function loadSynchronizedByUserRoles(array $role_ids);

  /**
   * Creates internal group roles for group types.
   *
   * Internal group roles are the bare minimum group roles that a group type
   * needs to function properly, such as the Member group role.
   *
   * @param string[] $group_type_ids
   *   (optional) A list of group type IDs to synchronize roles for. Leave empty
   *   to synchronize roles for all group types.
   */
  public function createInternal($group_type_ids = NULL);

  /**
   * Creates group roles for all user roles.
   *
   * @param string[] $group_type_ids
   *   (optional) A list of group type IDs to synchronize roles for. Leave empty
   *   to synchronize roles for all group types.
   * @param string[] $role_ids
   *   (optional) A list of user role IDs to synchronize. Leave empty to
   *   synchronize all user roles.
   */
  public function createSynchronized($group_type_ids = NULL, $role_ids = NULL);

  /**
   * Updates the label of all group roles for a user role.
   *
   * @param \Drupal\User\RoleInterface $role
   *   The user role to update the group role labels for.
   */
  public function updateSynchronizedLabels(RoleInterface $role);

  /**
   * Resets the internal, static cache used by ::loadByUserAndGroup().
   *
   * @param \Drupal\Core\Session\AccountInterface $account
   *   The account to reset the cached group roles for.
   * @param \Drupal\group\Entity\GroupInterface $group
   *   (optional) The group to reset the user's cached group roles for. Leave
   *   blank to reset the user's roles in all groups.
   */
  public function resetUserGroupRoleCache(AccountInterface $account, GroupInterface $group = NULL);

}

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::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, static entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1
GroupRoleStorageInterface::createInternal public function Creates internal group roles for group types. 1
GroupRoleStorageInterface::createSynchronized public function Creates group roles for all user roles. 1
GroupRoleStorageInterface::loadByUserAndGroup public function Retrieves all GroupRole entities for a user within a group. 1
GroupRoleStorageInterface::loadSynchronizedByGroupTypes public function Retrieves all synchronized GroupRole entities by group types. 1
GroupRoleStorageInterface::loadSynchronizedByUserRoles public function Retrieves all synchronized GroupRole entities by user roles. 1
GroupRoleStorageInterface::resetUserGroupRoleCache public function Resets the internal, static cache used by ::loadByUserAndGroup(). 1
GroupRoleStorageInterface::updateSynchronizedLabels public function Updates the label of all group roles for a user role. 1