Class Identity
Property Summary
-
$authorization protected
Authorization\AuthorizationServiceInterface
Authorization Service
-
$identity protected
Authentication\IdentityInterface
Identity 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
bool
applyScope() ¶ public
applyScope(string $action, mixed $resource, mixed ...$optionalArgs): mixed
Apply authorization scope conditions/restrictions.
Parameters
-
string
$action -
mixed
$resource -
mixed
...$optionalArgs
Returns
mixed
can() ¶ public
can(string $action, mixed $resource): bool
Check whether the current identity can perform an action.
Parameters
-
string
$action -
mixed
$resource
Returns
bool
canResult() ¶ 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\ResultInterface
getIdentifier() ¶ 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|null
getOriginalData() ¶ 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|array
offsetExists() ¶ public
offsetExists(mixed $offset): bool
Whether a offset exists
Parameters
-
mixed
$offset Offset
Returns
bool
Links
offsetGet() ¶ public
offsetGet(mixed $offset): mixed
Offset to retrieve
Parameters
-
mixed
$offset Offset
Returns
mixed
Links
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
void
Links
offsetUnset() ¶ public
offsetUnset(mixed $offset): void
Offset to unset
Parameters
-
mixed
$offset Offset
Returns
void