public function CurrentUser::__construct in Commerce Core 8.2
Constructs a new CurrentUser 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.
\Drupal\Core\Session\AccountInterface $current_user: The current user.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
\Drupal\user\PermissionHandlerInterface $permission_handler: The permission handler.
Overrides PluginBase::__construct
File
- src/
Plugin/ views/ argument_validator/ CurrentUser.php, line 76
Class
- CurrentUser
- Validates whether the argument matches the current user.
Namespace
Drupal\commerce\Plugin\views\argument_validatorCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, PermissionHandlerInterface $permission_handler) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->currentUser = $current_user;
$this->entityTypeManager = $entity_type_manager;
$this->moduleHandler = $module_handler;
$this->permissionHandler = $permission_handler;
}