You are here

public function UserManager::__construct in Social Post 3.x

Same name and namespace in other branches
  1. 8.2 src/User/UserManager.php \Drupal\social_post\User\UserManager::__construct()

Constructor.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Used for loading and creating Social Post entities.

\Drupal\Core\Messenger\MessengerInterface $messenger: Used to display messages to user.

\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: Used for logging errors.

\Drupal\Core\Session\AccountProxyInterface $current_user: Used to get current active user.

Overrides UserManager::__construct

File

src/User/UserManager.php, line 40

Class

UserManager
Manages database related tasks.

Namespace

Drupal\social_post\User

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, MessengerInterface $messenger, LoggerChannelFactoryInterface $logger_factory, AccountProxyInterface $current_user) {
  parent::__construct('social_post', $entity_type_manager, $messenger, $logger_factory);
  $this->currentUser = $current_user;
}