GatheringAttendancesTable
extends Table
in package
GatheringAttendances Model
Join table connecting members to gatherings with attendance information and various sharing permission options.
Table of Contents
Properties
- $Creators : MembersTable|BelongsTo
- $Gatherings : GatheringsTable|BelongsTo
- $Members : MembersTable|BelongsTo
- $Modifiers : MembersTable|BelongsTo
Methods
- applyRoyalProgress() : bool
- Apply (or clear) royal progress metadata on an attendance record.
- beforeSave() : void
- Enforce minor RSVP sharing rules.
- buildRules() : RulesChecker
- Returns a rules checker object that will be used for validating application integrity.
- currentProgressOfficersForMember() : array<string|int, Officer>
- List a member's current officer assignments for progress-eligible offices.
- findOrCreate() : GatheringAttendance
- findPublic() : SelectQuery
- Finder for public attendances
- findRoyalProgress() : SelectQuery
- Finder for royal progress attendances
- findShared() : SelectQuery
- Finder for any shared attendances
- findSharedWithCrown() : SelectQuery
- Finder for attendances shared with crown
- findSharedWithHostingGroup() : SelectQuery
- Finder for attendances shared with hosting group
- findSharedWithKingdom() : SelectQuery
- Finder for attendances shared with kingdom
- get() : GatheringAttendance
- getAttendanceCount() : int
- Get attendance count for a gathering
- initialize() : void
- Initialize method
- isAttending() : bool
- Check if a member is attending a gathering
- newEmptyEntity() : GatheringAttendance
- newEntities() : array<string|int, GatheringAttendance>
- newEntity() : GatheringAttendance
- patchEntities() : array<string|int, GatheringAttendance>
- patchEntity() : GatheringAttendance
- save() : GatheringAttendance|false
- saveOrFail() : GatheringAttendance
- validationDefault() : Validator
- Default validation rules.
Properties
$Creators
public
MembersTable|BelongsTo
$Creators
$Gatherings
public
GatheringsTable|BelongsTo
$Gatherings
$Members
public
MembersTable|BelongsTo
$Members
$Modifiers
public
MembersTable|BelongsTo
$Modifiers
Methods
applyRoyalProgress()
Apply (or clear) royal progress metadata on an attendance record.
public
applyRoyalProgress(GatheringAttendance $attendance, int|null $officerId, int $memberId) : bool
Verifies the given officer assignment belongs to the member, is current, and is for a progress-eligible office, then snapshots the office and branch names so the progress record keeps its meaning after the office holder changes (issue #62). Progress RSVPs are always shared with the kingdom — being publicly visible is the point of progress.
Parameters
- $attendance : GatheringAttendance
-
Attendance entity (not yet saved)
- $officerId : int|null
-
officers_officers.id to record progress for, or null to clear
- $memberId : int
-
Member the attendance belongs to
Return values
bool —False when the officer assignment is invalid for progress
beforeSave()
Enforce minor RSVP sharing rules.
public
beforeSave(EventInterface $event, EntityInterface $entity, ArrayObject $options) : void
Members under 18 cannot share RSVPs with the kingdom.
Parameters
- $event : EventInterface
-
Event
- $entity : EntityInterface
-
Entity being saved
- $options : ArrayObject
-
Save options
buildRules()
Returns a rules checker object that will be used for validating application integrity.
public
buildRules(RulesChecker $rules) : RulesChecker
Parameters
- $rules : RulesChecker
-
The rules object to be modified.
Return values
RulesCheckercurrentProgressOfficersForMember()
List a member's current officer assignments for progress-eligible offices.
public
currentProgressOfficersForMember(int $memberId) : array<string|int, Officer>
Used to offer the "attend as royal progress" option when the member currently holds a Crown/Coronet style office (offices flagged with is_royal_progress).
Parameters
- $memberId : int
-
Member id
Return values
array<string|int, Officer> —Current progress-eligible assignments
findOrCreate()
public
findOrCreate(mixed $search[, callable|null $callback = = 'null' ][, array<string|int, mixed> $options = = '[]' ]) : GatheringAttendance
Parameters
- $search : mixed
- $callback : callable|null = = 'null'
- $options : array<string|int, mixed> = = '[]'
Return values
GatheringAttendancefindPublic()
Finder for public attendances
public
findPublic(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
Return values
SelectQueryfindRoyalProgress()
Finder for royal progress attendances
public
findRoyalProgress(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
Return values
SelectQueryfindShared()
Finder for any shared attendances
public
findShared(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
Return values
SelectQueryfindSharedWithCrown()
Finder for attendances shared with crown
public
findSharedWithCrown(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
Return values
SelectQueryfindSharedWithHostingGroup()
Finder for attendances shared with hosting group
public
findSharedWithHostingGroup(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
Return values
SelectQueryfindSharedWithKingdom()
Finder for attendances shared with kingdom
public
findSharedWithKingdom(SelectQuery $query) : SelectQuery
Parameters
- $query : SelectQuery
-
The query to modify
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) : GatheringAttendance
Parameters
- $primaryKey : mixed
- $finder : array<string|int, mixed>|string = = '\'all\''
- $cache : CacheInterface|string|null = = 'null'
- $cacheKey : Closure|string|null = = 'null'
- $args : mixed
Return values
GatheringAttendancegetAttendanceCount()
Get attendance count for a gathering
public
getAttendanceCount(int $gatheringId) : int
Parameters
- $gatheringId : int
-
The gathering ID
Return values
intinitialize()
Initialize method
public
initialize(array<string, mixed> $config) : void
Parameters
- $config : array<string, mixed>
-
The configuration for the Table.
isAttending()
Check if a member is attending a gathering
public
isAttending(int $gatheringId, int $memberId) : bool
Parameters
- $gatheringId : int
-
The gathering ID
- $memberId : int
-
The member ID
Return values
boolnewEmptyEntity()
public
newEmptyEntity() : GatheringAttendance
Return values
GatheringAttendancenewEntities()
public
newEntities(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : array<string|int, GatheringAttendance>
Parameters
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
array<string|int, GatheringAttendance>newEntity()
public
newEntity(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : GatheringAttendance
Parameters
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
GatheringAttendancepatchEntities()
public
patchEntities(iterable<string|int, mixed> $entities, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : array<string|int, GatheringAttendance>
Parameters
- $entities : iterable<string|int, mixed>
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
array<string|int, GatheringAttendance>patchEntity()
public
patchEntity(EntityInterface $entity, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : GatheringAttendance
Parameters
- $entity : EntityInterface
- $data : array<string|int, mixed>
- $options : array<string|int, mixed> = = '[]'
Return values
GatheringAttendancesave()
public
save(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : GatheringAttendance|false
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
GatheringAttendance|falsesaveOrFail()
public
saveOrFail(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : GatheringAttendance
Parameters
- $entity : EntityInterface
- $options : array<string|int, mixed> = = '[]'
Return values
GatheringAttendancevalidationDefault()
Default validation rules.
public
validationDefault(Validator $validator) : Validator
Parameters
- $validator : Validator
-
Validator instance.