KMP PHP API Reference

LevelsTable extends BaseTable
in package

Manages award level data with hierarchical precedence ordering.

Implements progression-based level organization for the awards hierarchy. Uses soft deletion and tracks user modifications for audit trail support.

See /docs/5.2.2-awards-levels-table.md for complete documentation.

Tags
mixin

Table of Contents

Constants

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

Properties

$Awards  : AwardsTable|HasMany
$Footprint  : FootprintBehavior|Behavior
$Timestamp  : TimestampBehavior|Behavior
$Trash  : TrashBehavior|Behavior

Methods

addBranchScopeQuery()  : SelectQuery
Add branch-based data scoping to a query.
afterDelete()  : void
After delete hook to capture impersonation audit trail entries.
afterSave()  : void
After-save handler for automatic cache invalidation.
buildRules()  : RulesChecker
Business rules for level name uniqueness validation.
deleteMany()  : iterable<string|int, Level>|ResultSetInterface<string|int, Level>|false
deleteManyOrFail()  : iterable<string|int, Level>|ResultSetInterface<string|int, Level>
findOrCreate()  : Level
get()  : Level
getAllLevelNames()  : array<string|int, mixed>
Get all level names ordered by progression.
initialize()  : void
Initialize table settings, associations, and behaviors.
newEmptyEntity()  : Level
newEntities()  : array<string|int, Level>
newEntity()  : Level
patchEntities()  : array<string|int, Level>
patchEntity()  : Level
save()  : Level|false
saveMany()  : iterable<string|int, Level>|ResultSetInterface<string|int, Level>|false
saveManyOrFail()  : iterable<string|int, Level>|ResultSetInterface<string|int, Level>
saveOrFail()  : Level
validationDefault()  : Validator
Default validation rules for level data.
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

$Footprint

public FootprintBehavior|Behavior $Footprint

$Timestamp

public TimestampBehavior|Behavior $Timestamp

Methods

addBranchScopeQuery()

Add branch-based data scoping to a query.

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

Child tables should override for custom branch relationships.

Parameters
$query : SelectQuery

The query to modify

$branchIDs : array<string|int, int>

Authorized branch IDs

Return values
SelectQuery

Query with branch filtering

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

Business rules for level name uniqueness 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, Level>|ResultSetInterface<string|int, Level>|false
Parameters
$entities : iterable<string|int, mixed>
$options : array<string|int, mixed> = = '[]'
Return values
iterable<string|int, Level>|ResultSetInterface<string|int, Level>|false

deleteManyOrFail()

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

findOrCreate()

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

get()

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

getAllLevelNames()

Get all level names ordered by progression.

public getAllLevelNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

Array of level names in hierarchical progression order

initialize()

Initialize table settings, associations, and behaviors.

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

The configuration for the Table.

newEntities()

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

newEntity()

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

patchEntities()

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

patchEntity()

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

save()

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

saveMany()

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

saveManyOrFail()

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

saveOrFail()

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

validationDefault()

Default validation rules for level 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


        
On this page

Search results