KMP PHP API Reference

RecommendationsTable extends BaseTable
in package

Manages award recommendations with complex state machine and workflow management.

Handles complete recommendation lifecycle from submission through approval to presentation. Implements automated state logging via afterSave() hooks and supports both authenticated and guest recommendation workflows.

See /docs/5.2.4-awards-recommendations-table.md for complete documentation.

Tags
mixin

Table of Contents

Constants

CACHE_GROUPS_TO_CLEAR  = []
CACHES_TO_CLEAR  = []
ID_CACHES_TO_CLEAR  = []

Properties

$AssignedEvent  : EventsTable|BelongsTo
$Awards  : AwardsTable|BelongsTo
$Branches  : BranchesTable|BelongsTo
$Events  : EventsTable|BelongsToMany
$Footprint  : FootprintBehavior|Behavior
$Members  : MembersTable|BelongsTo
$Notes  : NotesTable|HasMany
$RecommendationStateLogs  : RecommendationsStatesLogsTable|HasMany
$Requesters  : MembersTable|BelongsTo
$ScheduledEvent  : EventsTable|BelongsTo
$Sortable  : SortableBehavior|Behavior
$Timestamp  : TimestampBehavior|Behavior
$Trash  : TrashBehavior|Behavior

Methods

addBranchScopeQuery()  : SelectQuery
Apply branch-based filtering to a recommendations query.
afterDelete()  : void
After delete hook to capture impersonation audit trail entries.
afterSave()  : void
After save lifecycle hook for automated state change logging.
beforeSave()  : void
Enforce recommendation workflow constraints before persisting changes.
buildRules()  : RulesChecker
Business rules for referential integrity validation.
deleteMany()  : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>|false
deleteManyOrFail()  : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>
findOrCreate()  : Recommendation
get()  : Recommendation
initialize()  : void
Configure the Recommendations table: table name, display/primary fields, behaviors, and associations.
newEmptyEntity()  : Recommendation
newEntities()  : array<string|int, Recommendation>
newEntity()  : Recommendation
patchEntities()  : array<string|int, Recommendation>
patchEntity()  : Recommendation
save()  : Recommendation|false
saveMany()  : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>|false
saveManyOrFail()  : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>
saveOrFail()  : Recommendation
validationDefault()  : Validator
Default validation rules for recommendation data.
logImpersonationAction()  : void
Record impersonated writes to audit log table.
logStateChange()  : void
Create audit trail record for state transitions.

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

Methods

addBranchScopeQuery()

Apply branch-based filtering to a recommendations query.

public addBranchScopeQuery(SelectQuery $query, array<string|int, int> $branchIDs) : SelectQuery

Filters the provided query so only records whose associated Awards.branch_id is contained in $branchIDs are returned. If $branchIDs is empty, the query is returned unchanged.

Parameters
$query : SelectQuery

The query to modify.

$branchIDs : array<string|int, int>

Array of branch IDs to restrict Awards.branch_id to.

Return values
SelectQuery

The query with branch filtering applied.

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 lifecycle hook for automated state change logging.

public afterSave(bool $created, EntityInterface $entity, ArrayObject $options) : void
Parameters
$created : bool

Whether the entity was created (true) or updated (false)

$entity : EntityInterface

The recommendation entity that was saved

$options : ArrayObject

Save operation options and configuration

beforeSave()

Enforce recommendation 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()

Business rules for referential integrity validation.

public buildRules(RulesChecker $rules) : RulesChecker
Parameters
$rules : RulesChecker

The rules object to be modified.

Return values
RulesChecker

deleteMany()

public deleteMany(iterable<string|int, mixed> $entities[, array<string|int, mixed> $options = = '[]' ]) : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>|false
Parameters
$entities : iterable<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>|false

deleteManyOrFail()

public deleteManyOrFail(iterable<string|int, mixed> $entities[, array<string|int, mixed> $options = = '[]' ]) : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>
Parameters
$entities : iterable<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>

findOrCreate()

public findOrCreate(mixed $search[, callable|null $callback = = 'null' ][, array<string|int, mixed> $options = = '[]' ]) : Recommendation
Parameters
$search : mixed
$callback : callable|null = = 'null'
$options : array<string|int, mixed> = = '[]'
Return values
Recommendation

get()

public get(mixed $primaryKey[, array<string|int, mixed>|string $finder = = '\'all\'' ][, CacheInterface|string|null $cache = = 'null' ][, Closure|string|null $cacheKey = = 'null' ], mixed ...$args) : Recommendation
Parameters
$primaryKey : mixed
$finder : array<string|int, mixed>|string = = '\'all\''
$cache : CacheInterface|string|null = = 'null'
$cacheKey : Closure|string|null = = 'null'
$args : mixed
Return values
Recommendation

initialize()

Configure the Recommendations table: table name, display/primary fields, behaviors, and associations.

public initialize(array<string, mixed> $config) : void

Sets the database table and primary/display fields, attaches timestamp, footprint, trash, and sortable behaviors, and defines associations used for member links, awards, events/gatherings, notes, and state logs.

Parameters
$config : array<string, mixed>

Table configuration options.

newEntities()

public newEntities(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : array<string|int, Recommendation>
Parameters
$data : array<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
array<string|int, Recommendation>

newEntity()

public newEntity(array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Recommendation
Parameters
$data : array<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
Recommendation

patchEntities()

public patchEntities(iterable<string|int, mixed> $entities, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : array<string|int, Recommendation>
Parameters
$entities : iterable<string|int, mixed>
$data : array<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
array<string|int, Recommendation>

patchEntity()

public patchEntity(EntityInterface $entity, array<string|int, mixed> $data[, array<string|int, mixed> $options = = '[]' ]) : Recommendation
Parameters
$entity : EntityInterface
$data : array<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
Recommendation

save()

public save(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Recommendation|false
Parameters
$entity : EntityInterface
$options : array<string|int, mixed> = = '[]'
Return values
Recommendation|false

saveMany()

public saveMany(iterable<string|int, mixed> $entities[, array<string|int, mixed> $options = = '[]' ]) : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>|false
Parameters
$entities : iterable<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>|false

saveManyOrFail()

public saveManyOrFail(iterable<string|int, mixed> $entities[, array<string|int, mixed> $options = = '[]' ]) : iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>
Parameters
$entities : iterable<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
iterable<string|int, Recommendation>|ResultSetInterface<string|int, Recommendation>

saveOrFail()

public saveOrFail(EntityInterface $entity[, array<string|int, mixed> $options = = '[]' ]) : Recommendation
Parameters
$entity : EntityInterface
$options : array<string|int, mixed> = = '[]'
Return values
Recommendation

validationDefault()

Default validation rules for recommendation data.

public validationDefault(Validator $validator) : Validator
Parameters
$validator : Validator

Validator instance.

Return values
Validator

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

logStateChange()

Create audit trail record for state transitions.

protected logStateChange(EntityInterface $entity) : void
Parameters
$entity : EntityInterface

The recommendation entity with state changes


        
On this page

Search results