AwardsTable
extends BaseTable
in package
Awards Table - Manages award configuration with Domain/Level/Branch hierarchy.
Tags
Table of Contents
Constants
- CACHE_GROUPS_TO_CLEAR = []
- CACHES_TO_CLEAR = []
- ID_CACHES_TO_CLEAR = []
Properties
- $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.
- findOrCreate() : 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.
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
$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
RulesCheckerfindOrCreate()
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
Awardget()
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