Class Identity
Property Summary
-
$authorization protected
Authorization\AuthorizationServiceInterfaceAuthorization Service
-
$identity protected
Authentication\IdentityInterfaceIdentity data
Method Summary
-
__call() public
Delegate unknown methods to decorated identity.
-
__construct() public
Constructor
-
__get() public
Delegate property access to decorated identity.
-
__isset() public
Delegate property isset to decorated identity.
-
applyScope() public
Apply authorization scope conditions/restrictions.
-
can() public
Check whether the current identity can perform an action.
-
canResult() public
Check whether the current identity can perform an action.
-
getIdentifier() public
Get the primary key/id field for the identity.
-
getOriginalData() public
Gets the original data object.
-
offsetExists() public
Whether a offset exists
-
offsetGet() public
Offset to retrieve
-
offsetSet() public
Offset to set
-
offsetUnset() public
Offset to unset
Method Detail
__call() ¶ public
__call(string $method, array $args): mixed
Delegate unknown methods to decorated identity.
Parameters
-
string$method The method being invoked.
-
array$args The arguments for the method.
Returns
mixed__construct() ¶ public
__construct(Authorization\AuthorizationServiceInterface $service, Authentication\IdentityInterface $identity)
Constructor
Parameters
-
Authorization\AuthorizationServiceInterface$service The authorization service.
-
Authentication\IdentityInterface$identity Identity data
__get() ¶ public
__get(string $property): mixed
Delegate property access to decorated identity.
Parameters
-
string$property The property to read.
Returns
mixed__isset() ¶ public
__isset(string $property): bool
Delegate property isset to decorated identity.
Parameters
-
string$property The property to read.
Returns
boolapplyScope() ¶ public
applyScope(string $action, mixed $resource, mixed ...$optionalArgs): mixed
Apply authorization scope conditions/restrictions.
Parameters
-
string$action -
mixed$resource -
mixed...$optionalArgs
Returns
mixedcan() ¶ public
can(string $action, mixed $resource): bool
Check whether the current identity can perform an action.
Parameters
-
string$action -
mixed$resource
Returns
boolcanResult() ¶ public
canResult(string $action, mixed $resource): Authorization\Policy\ResultInterface
Check whether the current identity can perform an action.
Parameters
-
string$action -
mixed$resource
Returns
Authorization\Policy\ResultInterfacegetIdentifier() ¶ public
getIdentifier(): array<array-key, mixed>|string|int|null
Get the primary key/id field for the identity.
Returns
array<array-key, mixed>|string|int|nullgetOriginalData() ¶ public
getOriginalData(): ArrayAccess|array
Gets the original data object.
If the decorated identity implements getOriginalData()
that method should be invoked to expose the original data.
Returns
ArrayAccess|arrayoffsetExists() ¶ public
offsetExists(mixed $offset): bool
Whether a offset exists
Parameters
-
mixed$offset Offset
Returns
boolLinks
offsetGet() ¶ public
offsetGet(mixed $offset): mixed
Offset to retrieve
Parameters
-
mixed$offset Offset
Returns
mixedLinks
offsetSet() ¶ public
offsetSet(mixed $offset, mixed $value): void
Offset to set
Parameters
-
mixed$offset The offset to assign the value to.
-
mixed$value Value
Returns
voidLinks
offsetUnset() ¶ public
offsetUnset(mixed $offset): void
Offset to unset
Parameters
-
mixed$offset Offset
Returns
void