public function ClientRepository::getClientEntity in Simple OAuth (OAuth2) & OpenID Connect 5.x
Same name and namespace in other branches
- 8.4 src/Repositories/ClientRepository.php \Drupal\simple_oauth\Repositories\ClientRepository::getClientEntity()
- 8.2 src/Repositories/ClientRepository.php \Drupal\simple_oauth\Repositories\ClientRepository::getClientEntity()
- 8.3 src/Repositories/ClientRepository.php \Drupal\simple_oauth\Repositories\ClientRepository::getClientEntity()
File
- src/
Repositories/ ClientRepository.php, line 33
Class
Namespace
Drupal\simple_oauth\RepositoriesCode
public function getClientEntity($client_identifier) {
$client_drupal_entities = $this->entityTypeManager
->getStorage('consumer')
->loadByProperties([
'uuid' => $client_identifier,
]);
// Check if the client is registered.
if (empty($client_drupal_entities)) {
return NULL;
}
/** @var \Drupal\consumers\Entity\Consumer $client_drupal_entity */
$client_drupal_entity = reset($client_drupal_entities);
return new ClientEntity($client_drupal_entity);
}