You are here

public function ScopeRepository::getScopeEntityByIdentifier in Simple OAuth (OAuth2) & OpenID Connect 5.x

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

File

src/Repositories/ScopeRepository.php, line 37

Class

ScopeRepository
The repository for scopes.

Namespace

Drupal\simple_oauth\Repositories

Code

public function getScopeEntityByIdentifier($scope_identifier) {
  $role = $this->entityTypeManager
    ->getStorage('user_role')
    ->load($scope_identifier);
  if (!$role) {
    return NULL;
  }
  return $this
    ->scopeFactory($role);
}