Scope implements ArrayCopyable, Arrayable, Jsonable Uses ArrayTrait, JsonTrait
Information about a scope.
Tags
Interfaces, Classes and Traits
- ArrayCopyable
- Interface to declare instances can be converted into/from arrays.
- Arrayable
- Interface to declare that instances can be converted into an array.
- Jsonable
- Interface to declare that instances can be converted into JSON strings.
Table of Contents
- copyFromArray() : mixed
- Copy the content of the given array into this object.
- copyToArray() : mixed
- Copy the content of this object into the given array.
- fromArray() : static
- Convert an array into an instance of this class.
- fromJson() : static
- Convert a JSON string into an instance of this class.
- getAttributes() : array<string|int, Pair>
- Get the attributes of this scope.
- getDescription() : string
- Get the description of this scope.
- getDescriptions() : array<string|int, TaggedValue>
- Get the localized descriptions of this scope.
- getName() : string
- Get the scope name.
- isDefault() : string
- Get the flag which indicates whether this scope is included in the default scope set.
- setAttributes() : Scope
- Set the attributes of this scope.
- setDefault() : Scope
- Set the flag which indicates whether this scope is included in the default scope set.
- setDescription() : Scope
- Set the description of this scope.
- setDescriptions() : Scope
- Set the localized descriptions of this scope.
- setName() : Scope
- Set the scope name.
- toArray() : array<string|int, mixed>
- Convert this object into an array.
- toJson() : string
- Convert this object into a JSON string.
Methods
copyFromArray()
Copy the content of the given array into this object.
public
copyFromArray(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —copyToArray()
Copy the content of this object into the given array.
public
copyToArray(array<string|int, mixed> &$array) : mixed
Parameters
- $array : array<string|int, mixed>
Return values
mixed —fromArray()
Convert an array into an instance of this class.
public
static fromArray([array<string|int, mixed> $array = null ]) : static
This static function returns a new instance of this class.
If $array
is null
, null
is returned.
Parameters
- $array : array<string|int, mixed> = null
-
An array
Return values
static —An instance of this class.
fromJson()
Convert a JSON string into an instance of this class.
public
static fromJson(string $json) : static
This static function returns a new instance of this class.
If $json
is null
or the type of $json
is not string
,
null
is returned.
Parameters
- $json : string
-
A JSON string.
Return values
static —An instance of this class.
getAttributes()
Get the attributes of this scope.
public
getAttributes() : array<string|int, Pair>
Return values
array<string|int, Pair> —The attributes of this scope.
getDescription()
Get the description of this scope.
public
getDescription() : string
Return values
string —The description of this scope.
getDescriptions()
Get the localized descriptions of this scope.
public
getDescriptions() : array<string|int, TaggedValue>
Return values
array<string|int, TaggedValue> —The localized descriptions of this scope.
getName()
Get the scope name.
public
getName() : string
Return values
string —The scope name.
isDefault()
Get the flag which indicates whether this scope is included in the default scope set.
public
isDefault() : string
Return values
string —true
if this scope is included in the default scope set.
setAttributes()
Set the attributes of this scope.
public
setAttributes([array<string|int, Pair> $attributes = null ]) : Scope
Parameters
- $attributes : array<string|int, Pair> = null
-
The attributes of this scope.
Return values
Scope —$this
object.
setDefault()
Set the flag which indicates whether this scope is included in the default scope set.
public
setDefault(string $default) : Scope
When an authorization request does not include the scope
request
parameter, scopes in the default scope set are used.
Parameters
- $default : string
-
true
to include this scope in the default scope set.
Return values
Scope —$this
object.
setDescription()
Set the description of this scope.
public
setDescription(string $description) : Scope
Parameters
- $description : string
-
The description of this scope.
Return values
Scope —$this
object.
setDescriptions()
Set the localized descriptions of this scope.
public
setDescriptions([array<string|int, TaggedValue> $descriptions = null ]) : Scope
Parameters
- $descriptions : array<string|int, TaggedValue> = null
-
The localized descriptions of this scope.
Return values
Scope —$this
object.
setName()
Set the scope name.
public
setName(string $name) : Scope
Valid characters for scope names are listed in 3.3. Access Token Scope of RFC 6749.
Parameters
- $name : string
-
The scope name.
Return values
Scope —$this
object.
toArray()
Convert this object into an array.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array.
toJson()
Convert this object into a JSON string.
public
toJson(int $options) : string
Parameters
- $options : int
-
Options passed to
json_encode()
. This parameter is optional and its default value is 0.
Return values
string —A JSON string.