public function RecentlyReadService::__construct in Recently Read 8
Constructor.
Parameters
\Drupal\Core\Session\AccountInterface $current_user: The current user.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity manager.
\Drupal\Core\Session\SessionManager $sessionManager: Session manager.
\Drupal\Core\Config\ConfigFactory $configFactory: Config factory service.
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
File
- src/
RecentlyReadService.php, line 66
Class
- RecentlyReadService
- Recently read service.
Namespace
Drupal\recently_readCode
public function __construct(AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, SessionManager $sessionManager, ConfigFactory $configFactory) {
$this->currentUser = $current_user;
$this->entityTypeManager = $entity_type_manager;
$this->sessionManager = $sessionManager;
$this->configFactory = $configFactory;
$this->recentlyReadStorage = $this->entityTypeManager
->getStorage('recently_read');
}