You are here

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

Class

ScopeRepository

Namespace

Drupal\simple_oauth\Repositories

Code

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