AwardsTable
extends BaseTable
in package
Awards Table - Manages award configuration with Domain/Level/Branch hierarchy.
Tags
Table of Contents
Constants
- CACHE_GROUPS_TO_CLEAR : array<string|int, string> = []
- CACHES_TO_CLEAR : array<string|int, array{string, string}> = []
- ID_CACHES_TO_CLEAR : array<string|int, array{string, string}> = []
Properties
- $ApprovalProcesses : ApprovalProcessesTable|BelongsTo
- $Branches : BranchesTable|BelongsTo
- $Domains : DomainsTable|BelongsTo
- $GatheringActivities : GatheringActivitiesTable|BelongsToMany
- $Levels : LevelsTable|BelongsTo
- $Recommendations : RecommendationsTable|HasMany
Methods
- addBranchScopeQuery() : SelectQuery
- Filter awards by allowed branch IDs.
- afterDelete() : void
- After delete hook to capture impersonation audit trail entries.
- afterSave() : void
- After-save handler for automatic cache invalidation.
- buildRules() : RulesChecker
- Build application rules for referential integrity.
- findActive() : SelectQuery
- Restrict results to active awards.
- findOrCreate() : Award
- findSelectable() : SelectQuery
- Restrict recommendation award selection to active awards, while optionally preserving the currently selected award.
- get() : Award
- getSchema() : TableSchemaInterface
- Get schema.
- initialize() : void
- newEmptyEntity() : Award
- newEntity() : Award
- patchEntity() : Award
- save() : Award|false
- saveOrFail() : Award
- validationDefault() : Validator
- Default validation rules.
- logImpersonationAction() : void
- Record impersonated writes to audit log table.
- setJsonColumnTypesIfPresent() : void
- Mark JSON columns when the table schema is available.
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
$ApprovalProcesses
public
ApprovalProcessesTable|BelongsTo
$ApprovalProcesses
$Branches
public
BranchesTable|BelongsTo
$Branches
$Domains
public
DomainsTable|BelongsTo
$Domains
$GatheringActivities
public
GatheringActivitiesTable|BelongsToMany
$GatheringActivities
$Levels
public
LevelsTable|BelongsTo
$Levels
$Recommendations
public
RecommendationsTable|HasMany
$Recommendations
Methods
addBranchScopeQuery()
Filter awards by allowed branch IDs.
public
addBranchScopeQuery(SelectQuery $query, array<string|int, int>|int $branchIDs) : SelectQuery
Parameters
- $query : SelectQuery
-
Query to filter
- $branchIDs : array<string|int, int>|int
-
Branch IDs to filter by
Return values
SelectQueryafterDelete()
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 application rules for referential integrity.
public
buildRules(RulesChecker $rules) : RulesChecker
Parameters
- $rules : RulesChecker
-
The rules object
Return values
RulesCheckerfindActive()
Restrict results to active awards.
public
findActive(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
Query to filter
Return values
SelectQueryfindOrCreate()
public
findOrCreate(mixed $search[, callable|null $callback = = 'null' ][, array<string|int, mixed> $options = = '[]' ]) : Award
Parameters
- $search : mixed
- $callback : callable|null = = 'null'
- $options : array<string|int, mixed> = = '[]'
Return values
AwardfindSelectable()
Restrict recommendation award selection to active awards, while optionally preserving the currently selected award.
public
findSelectable(SelectQuery $query, array<string, mixed> $options) : SelectQuery
Parameters
- $query : SelectQuery
-
Query to filter
- $options : array<string, mixed>
-
Finder options
Return values
SelectQueryget()
public
get(mixed $primaryKey[, array<string|int, mixed>|string $finder = = '\'all\'' ][, CacheInterface|string|null $cache = = 'null' ][, Closure|string|null $cacheKey = = 'null' ], mixed ...$args) : Award
Parameters
- $primaryKey : mixed
- $finder : array<string|int, mixed>|string = = '\'all\''
- $cache : CacheInterface|string|null = = 'null'
- $cacheKey : Closure|string|null = = 'null'
- $args : mixed
Return values
AwardgetSchema()
Get schema.
public
getSchema() : TableSchemaInterface
Return values
TableSchemaInterfaceinitialize()
public
initialize(array<string, mixed> $config) : void
Parameters
- $config : array<string, mixed>
-
Configuration options
newEmptyEntity()
public
newEmptyEntity() : Award
Return values
AwardnewEntity()
public
newEntity(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Award
Parameters
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
AwardpatchEntity()
public
patchEntity(EntityInterface $entity, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Award
Parameters
- $entity : EntityInterface
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
Awardsave()
public
save(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Award|false
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
Award|falsesaveOrFail()
public
saveOrFail(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Award
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
AwardvalidationDefault()
Default validation rules.
public
validationDefault(Validator $validator) : Validator
Parameters
- $validator : Validator
-
Validator instance
Return values
ValidatorlogImpersonationAction()
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
setJsonColumnTypesIfPresent()
Mark JSON columns when the table schema is available.
protected
setJsonColumnTypesIfPresent(array<int, string> $columns) : void
Some reset/migration flows instantiate table classes before every table exists. JSON type mapping is optional metadata, so skip it until the schema can be described instead of failing application bootstrap.
Parameters
- $columns : array<int, string>
-
JSON column names.