You are here

public function SocialAddRoleUser::__construct in Open Social 10.1.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php \Drupal\social_user\Plugin\Action\SocialAddRoleUser::__construct()
  2. 8.7 modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php \Drupal\social_user\Plugin\Action\SocialAddRoleUser::__construct()
  3. 8.8 modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php \Drupal\social_user\Plugin\Action\SocialAddRoleUser::__construct()
  4. 10.3.x modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php \Drupal\social_user\Plugin\Action\SocialAddRoleUser::__construct()
  5. 10.0.x modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php \Drupal\social_user\Plugin\Action\SocialAddRoleUser::__construct()
  6. 10.2.x modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php \Drupal\social_user\Plugin\Action\SocialAddRoleUser::__construct()

Constructs a \Drupal\Component\Plugin\PluginBase object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides ChangeUserRoleBase::__construct

File

modules/social_features/social_user/src/Plugin/Action/SocialAddRoleUser.php, line 42

Class

SocialAddRoleUser
Adds a role to a user but restricted by role.

Namespace

Drupal\social_user\Plugin\Action

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeInterface $entity_type, AccountProxyInterface $currentUser, DelegatableRolesInterface $delegatableRoles) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type);
  $this->entityType = $entity_type;
  $this->currentUser = $currentUser
    ->getAccount();
  $this->delegatableRoles = $delegatableRoles;
}