You are here

protected function ScopeRepository::scopeFactory 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::scopeFactory()
  2. 8.2 src/Repositories/ScopeRepository.php \Drupal\simple_oauth\Repositories\ScopeRepository::scopeFactory()
  3. 8.3 src/Repositories/ScopeRepository.php \Drupal\simple_oauth\Repositories\ScopeRepository::scopeFactory()

Build a scope entity.

Parameters

\Drupal\user\RoleInterface $role: The associated role.

Return value

\League\OAuth2\Server\Entities\ScopeEntityInterface The initialized scope entity.

2 calls to ScopeRepository::scopeFactory()
ScopeRepository::addRoleToScopes in src/Repositories/ScopeRepository.php
Add an additional scope if it's not present.
ScopeRepository::getScopeEntityByIdentifier in src/Repositories/ScopeRepository.php

File

src/Repositories/ScopeRepository.php, line 98

Class

ScopeRepository
The repository for scopes.

Namespace

Drupal\simple_oauth\Repositories

Code

protected function scopeFactory(RoleInterface $role) {
  return new ScopeEntity($role);
}