You are here

public function ScopeRepository::getScopeEntityByIdentifier in Simple OAuth (OAuth2) & OpenID Connect 8.2

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

File

src/Repositories/ScopeRepository.php, line 32

Class

ScopeRepository

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);
}