class ScopeEntity in Simple OAuth (OAuth2) & OpenID Connect 8.3
Same name and namespace in other branches
- 8.4 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity
- 8.2 src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity
- 5.x src/Entities/ScopeEntity.php \Drupal\simple_oauth\Entities\ScopeEntity
Hierarchy
- class \Drupal\simple_oauth\Entities\ScopeEntity implements ScopeEntityNameInterface 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\EntitiesView source
class ScopeEntity implements ScopeEntityNameInterface {
use EntityTrait, RefinableCacheableDependencyTrait;
/**
* The name of this scope.
*
* @var string
*/
protected $name;
/**
* 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());
$this->name = $role
->label();
$this
->addCacheableDependency($role);
}
/**
* {@inheritdoc}
*/
public function jsonSerialize() {
return $this
->getIdentifier();
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this->name;
}
/**
* {@inheritdoc}
*/
public function getDescription() {
// Roles have no description.
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyInterface:: |
public | function | The cache contexts associated with this object. | 34 |
CacheableDependencyInterface:: |
public | function | The maximum age for which this object may be cached. | 34 |
CacheableDependencyInterface:: |
public | function | The cache tags associated with this object. | 27 |
ScopeEntity:: |
protected | property | The name of this scope. | |
ScopeEntity:: |
public | function |
Returns a description for the scope. Overrides ScopeEntityNameInterface:: |
|
ScopeEntity:: |
public | function |
Returns a name for the scope. Overrides ScopeEntityNameInterface:: |
|
ScopeEntity:: |
public | function | ||
ScopeEntity:: |
public | function | Construct a ScopeEntity instance. |