You are here

public function ExpiredCollector::__construct in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 src/ExpiredCollector.php \Drupal\simple_oauth\ExpiredCollector::__construct()
  2. 8.2 src/ExpiredCollector.php \Drupal\simple_oauth\ExpiredCollector::__construct()
  3. 8.3 src/ExpiredCollector.php \Drupal\simple_oauth\ExpiredCollector::__construct()

ExpiredCollector constructor.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Component\Datetime\TimeInterface $date_time: The date time service.

Throws

\Drupal\Component\Plugin\Exception\PluginException

File

src/ExpiredCollector.php, line 47

Class

ExpiredCollector
Service in charge of deleting or expiring tokens that cannot be used anymore.

Namespace

Drupal\simple_oauth

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, TimeInterface $date_time) {
  $this->clientStorage = $entity_type_manager
    ->getStorage('consumer');
  $this->tokenStorage = $entity_type_manager
    ->getStorage('oauth2_token');
  $this->dateTime = $date_time;
}