AuthorizationsTable
extends BaseTable
in package
Manages Authorization entities for member activity participation workflows.
Provides data access, temporal lifecycle management, and status validation for authorization requests. Implements ActiveWindow behavior for automatic expiration processing and temporal queries.
Tags
Table of Contents
Constants
- CACHE_GROUPS_TO_CLEAR = []
- CACHES_TO_CLEAR = []
- ID_CACHES_TO_CLEAR = []
Properties
- $Activities : ActivitiesTable|BelongsTo
- $AuthorizationApprovals : AuthorizationApprovalsTable|HasMany
- $CurrentPendingApprovals : AuthorizationApprovalsTable|HasOne
- $MemberRoles : MemberRolesTable|BelongsTo
- $Members : MembersTable|BelongsTo
- $RevokedBy : MembersTable|BelongsTo
Methods
- addBranchScopeQuery() : SelectQuery
- Add branch-based data scoping to a query.
- afterDelete() : void
- After delete hook to capture impersonation audit trail entries.
- afterSave() : void
- After-save handler for automatic cache invalidation.
- buildRules() : RulesChecker
- Build rules ensuring referential integrity for member and activity associations.
- findPending() : SelectQuery
- Custom finder for pending authorization requests.
- get() : Authorization
- initialize() : void
- Initialize method - configures associations, behaviors, and automated status management.
- newEmptyEntity() : Authorization
- newEntity() : Authorization
- save() : Authorization|false
- validationDefault() : Validator
- Default validation rules for authorization data integrity.
- checkStatus() : void
- Batch update expired authorizations to EXPIRED status.
- logImpersonationAction() : void
- Record impersonated writes to audit log table.
Constants
CACHE_GROUPS_TO_CLEAR
protected
array<string|int, string>
CACHE_GROUPS_TO_CLEAR
= []
Cache groups to clear entirely on save
CACHES_TO_CLEAR
protected
array<string|int, array{string, string}>
CACHES_TO_CLEAR
= []
Static cache entries to clear on save
ID_CACHES_TO_CLEAR
protected
array<string|int, array{string, string}>
ID_CACHES_TO_CLEAR
= []
Entity-ID cache prefixes to clear on save
Properties
$Activities
public
ActivitiesTable|BelongsTo
$Activities
$AuthorizationApprovals
public
AuthorizationApprovalsTable|HasMany
$AuthorizationApprovals
$CurrentPendingApprovals
public
AuthorizationApprovalsTable|HasOne
$CurrentPendingApprovals
$MemberRoles
public
MemberRolesTable|BelongsTo
$MemberRoles
$Members
public
MembersTable|BelongsTo
$Members
$RevokedBy
public
MembersTable|BelongsTo
$RevokedBy
Methods
addBranchScopeQuery()
Add branch-based data scoping to a query.
public
addBranchScopeQuery(SelectQuery $query, array<string|int, int> $branchIDs) : SelectQuery
Child tables should override for custom branch relationships.
Parameters
- $query : SelectQuery
-
The query to modify
- $branchIDs : array<string|int, int>
-
Authorized branch IDs
Return values
SelectQuery —Query with branch filtering
afterDelete()
After delete hook to capture impersonation audit trail entries.
public
afterDelete(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Parameters
- $event : EventInterface
-
Delete event
- $entity : EntityInterface
-
Entity being deleted
- $options : ArrayObject
-
Delete options
afterSave()
After-save handler for automatic cache invalidation.
public
afterSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Parameters
- $event : EventInterface
-
The afterSave event
- $entity : EntityInterface
-
The saved entity
- $options : ArrayObject
-
Save options
buildRules()
Build rules ensuring referential integrity for member and activity associations.
public
buildRules(RulesChecker $rules) : RulesChecker
Parameters
- $rules : RulesChecker
-
The rules checker
Return values
RulesChecker —Configured rules
findPending()
Custom finder for pending authorization requests.
public
findPending(SelectQuery $query) : SelectQuery
Filters to authorizations with PENDING status for approval workflow processing.
Parameters
- $query : SelectQuery
-
The base query
Return values
SelectQuery —Modified query filtered for pending status
get()
public
get(mixed $primaryKey[, array<string|int, mixed>|string $finder = = '\'all\'' ][, CacheInterface|string|null $cache = = 'null' ][, Closure|string|null $cacheKey = = 'null' ], mixed ...$args) : Authorization
Parameters
- $primaryKey : mixed
- $finder : array<string|int, mixed>|string = = '\'all\''
- $cache : CacheInterface|string|null = = 'null'
- $cacheKey : Closure|string|null = = 'null'
- $args : mixed
Return values
Authorizationinitialize()
Initialize method - configures associations, behaviors, and automated status management.
public
initialize(array<string, mixed> $config) : void
Runs daily status check to transition expired authorizations to EXPIRED status.
Parameters
- $config : array<string, mixed>
-
The configuration for the Table
newEmptyEntity()
public
newEmptyEntity() : Authorization
Return values
AuthorizationnewEntity()
public
newEntity(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Authorization
Parameters
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
Authorizationsave()
public
save(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Authorization|false
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
Authorization|falsevalidationDefault()
Default validation rules for authorization data integrity.
public
validationDefault(Validator $validator) : Validator
Parameters
- $validator : Validator
-
Validator instance
Return values
Validator —Configured validator
checkStatus()
Batch update expired authorizations to EXPIRED status.
protected
checkStatus() : void
Called automatically during table initialization when NextStatusCheck is past. Transitions APPROVED and PENDING authorizations past their expires_on date.
logImpersonationAction()
Record impersonated writes to audit log table.
protected
logImpersonationAction(string $defaultOperation, EntityInterface $entity) : void
Parameters
- $defaultOperation : string
-
Operation fallback (save/delete)
- $entity : EntityInterface
-
Affected entity