You are here

class ScopeEntity in Simple OAuth (OAuth2) & OpenID Connect 8.2

Same name and namespace in other branches
  1. 8.4 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity
  2. 8.3 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity
  3. 5.x src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity

Hierarchy

  • class \Drupal\simple_oauth\Entities\ScopeEntity implements \League\OAuth2\Server\Entities\ScopeEntityInterface uses \League\OAuth2\Server\Entities\Traits\EntityTrait

Expanded class hierarchy of ScopeEntity

1 file declares its use of ScopeEntity
ScopeRepository.php in src/Repositories/ScopeRepository.php

File

src/Entities/ScopeEntity.php, line 9

Namespace

Drupal\simple_oauth\Entities
View source
class ScopeEntity implements ScopeEntityInterface {
  use EntityTrait;

  /**
   * Construct a ScopeEntity instance.
   *
   * @param \Drupal\User\RoleInterface $role
   *   The role associated to the scope.
   */
  public function __construct(RoleInterface $role) {
    $this->role = $role;
    $this
      ->setIdentifier($role
      ->id());
  }
  public function jsonSerialize() {
    return $this
      ->getIdentifier();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ScopeEntity::jsonSerialize public function
ScopeEntity::__construct public function Construct a ScopeEntity instance.