public function CurrentUserContext::__construct in Page Manager 8
Same name and namespace in other branches
- 8.4 src/EventSubscriber/CurrentUserContext.php \Drupal\page_manager\EventSubscriber\CurrentUserContext::__construct()
Constructs a new CurrentUserContext.
Parameters
\Drupal\Core\Session\AccountInterface $account: The current account.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
File
- src/
EventSubscriber/ CurrentUserContext.php, line 49 - Contains \Drupal\page_manager\EventSubscriber\CurrentUserContext.
Class
- CurrentUserContext
- Sets the current user as a context.
Namespace
Drupal\page_manager\EventSubscriberCode
public function __construct(AccountInterface $account, EntityTypeManagerInterface $entity_type_manager) {
$this->account = $account;
$this->userStorage = $entity_type_manager
->getStorage('user');
}