You are here

public function ScopeEntity::__construct in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity::__construct()
  2. 8.2 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity::__construct()
  3. 8.3 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity::__construct()

Construct a ScopeEntity instance.

Parameters

\Drupal\User\RoleInterface $role: The role associated to the scope.

1 method overrides ScopeEntity::__construct()
OpenIdConnectScopeEntity::__construct in src/Entities/OpenIdConnectScopeEntity.php
OpenIdConnectScopeEntity constructor.

File

src/Entities/ScopeEntity.php, line 26

Class

ScopeEntity

Namespace

Drupal\simple_oauth\Entities

Code

public function __construct(RoleInterface $role) {
  $this->role = $role;
  $this
    ->setIdentifier($role
    ->id());
  $this->name = $role
    ->label();
  $this
    ->addCacheableDependency($role);
}