You are here

public function ScopeEntity::__construct in Simple OAuth (OAuth2) & OpenID Connect 8.3

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. 5.x 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.

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