BestowalsTable
extends BaseTable
in package
Manages award bestowals and their workflow-facing persistence rules.
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
- $Awards : AwardsTable|BelongsTo
- $BestowalRecommendations : BestowalRecommendationsTable|HasMany
- $Gatherings : GatheringsTable|BelongsTo
- $GatheringScheduledActivities : GatheringScheduledActivitiesTable|BelongsTo
- $Members : MembersTable|BelongsTo
- $Notes : NotesTable|HasMany
- $PrimaryRecommendation : RecommendationsTable|BelongsTo
- $Recommendations : RecommendationsTable|BelongsToMany
- $SourceApprovalRun : RecommendationApprovalRunsTable|BelongsTo
Methods
- addBranchScopeQuery() : SelectQuery
- Apply branch-based filtering to a bestowals query via award branch.
- afterDelete() : void
- After delete hook to capture impersonation audit trail entries.
- afterSave() : void
- Keep the gathering's court agenda in sync with the bestowal's court assignment.
- beforeMarshal() : void
- Derive the recipient display name from the linked member when it is omitted.
- beforeSave() : void
- Enforce bestowal workflow constraints before persisting changes.
- buildRules() : RulesChecker
- get() : Bestowal
- initialize() : void
- newEmptyEntity() : Bestowal
- newEntity() : Bestowal
- patchEntity() : Bestowal
- save() : Bestowal|false
- saveOrFail() : Bestowal
- validationDefault() : Validator
- Default validation rules for bestowal data.
- 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
$Awards
public
AwardsTable|BelongsTo
$Awards
$BestowalRecommendations
public
BestowalRecommendationsTable|HasMany
$BestowalRecommendations
$Gatherings
public
GatheringsTable|BelongsTo
$Gatherings
$GatheringScheduledActivities
public
GatheringScheduledActivitiesTable|BelongsTo
$GatheringScheduledActivities
$Members
public
MembersTable|BelongsTo
$Members
$Notes
public
NotesTable|HasMany
$Notes
$PrimaryRecommendation
public
RecommendationsTable|BelongsTo
$PrimaryRecommendation
$Recommendations
public
RecommendationsTable|BelongsToMany
$Recommendations
$SourceApprovalRun
public
RecommendationApprovalRunsTable|BelongsTo
$SourceApprovalRun
Methods
addBranchScopeQuery()
Apply branch-based filtering to a bestowals query via award branch.
public
addBranchScopeQuery(SelectQuery $query, array<string|int, int> $branchIDs) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify.
- $branchIDs : array<string|int, int>
-
Branch IDs to restrict bestowals to.
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()
Keep the gathering's court agenda in sync with the bestowal's court assignment.
public
afterSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Whenever the gathering or court-slot fields change, the default court agenda mirrors the assignment in real time (item created, moved, or removed), so the agenda never needs a manual bestowal sync.
Parameters
- $event : EventInterface
-
The afterSave event.
- $entity : EntityInterface
-
The persisted entity.
- $options : ArrayObject
-
Save operation options.
beforeMarshal()
Derive the recipient display name from the linked member when it is omitted.
public
beforeMarshal(EventInterface $event, ArrayObject $data, ArrayObject $options) : void
member_sca_name is the required display source of truth for a bestowal, but
member-linked bestowals (recommendation-sourced or member-selected ad-hoc) do not
resubmit the recipient name. Backfill it from the member record so direct saves and
recommendation/court flows remain valid without forcing every caller to repeat it.
Ad-hoc bestowals without a member keep supplying the name explicitly.
Parameters
- $event : EventInterface
-
The beforeMarshal event.
- $data : ArrayObject
-
Inbound marshalling data.
- $options : ArrayObject
-
Marshalling options.
beforeSave()
Enforce bestowal workflow constraints before persisting changes.
public
beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Parameters
- $event : EventInterface
-
The beforeSave event.
- $entity : EntityInterface
-
The entity being persisted.
- $options : ArrayObject
-
Save operation options.
buildRules()
public
buildRules(RulesChecker $rules) : RulesChecker
Parameters
- $rules : RulesChecker
-
The rules object
Return values
RulesCheckerget()
public
get(mixed $primaryKey[, array<string|int, mixed>|string $finder = = '\'all\'' ][, CacheInterface|string|null $cache = = 'null' ][, Closure|string|null $cacheKey = = 'null' ], mixed ...$args) : Bestowal
Parameters
- $primaryKey : mixed
- $finder : array<string|int, mixed>|string = = '\'all\''
- $cache : CacheInterface|string|null = = 'null'
- $cacheKey : Closure|string|null = = 'null'
- $args : mixed
Return values
Bestowalinitialize()
public
initialize(array<string, mixed> $config) : void
Parameters
- $config : array<string, mixed>
-
Table configuration options
newEmptyEntity()
public
newEmptyEntity() : Bestowal
Return values
BestowalnewEntity()
public
newEntity(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Bestowal
Parameters
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
BestowalpatchEntity()
public
patchEntity(EntityInterface $entity, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Bestowal
Parameters
- $entity : EntityInterface
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
Bestowalsave()
public
save(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Bestowal|false
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
Bestowal|falsesaveOrFail()
public
saveOrFail(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Bestowal
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
BestowalvalidationDefault()
Default validation rules for bestowal data.
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.