KMP PHP API Reference

SyncActiveWindowStatusesCommand extends Command
in package

CLI command to synchronize ActiveWindow-based entity statuses.

Transition entities from Upcoming -> Current and Current -> Expired based on their configured start_on/expires_on window. Intended for scheduled execution via cron or other automation.

Table of Contents

Methods

buildOptionParser()  : ConsoleOptionParser
execute()  : int
Execute command.
collectTableAliases()  : array<string|int, string>
Collect table aliases from the application or a plugin.
discoverActiveWindowTableAliases()  : array<string|int, string>
Discover table aliases whose entities extend ActiveWindowBaseEntity.
evaluateAlias()  : array<string|int, string>
Evaluate alias and append when entity inherits ActiveWindowBaseEntity.
synchronizeTable()  : array{upcoming_to_current: int, current_to_expired: int, errors: int}
Synchronize statuses for a table whose entity extends ActiveWindowBaseEntity.

Methods

buildOptionParser()

public buildOptionParser(ConsoleOptionParser $parser) : ConsoleOptionParser
Parameters
$parser : ConsoleOptionParser
Tags
inheritDoc
Return values
ConsoleOptionParser

execute()

Execute command.

public execute(Arguments $args, ConsoleIo $io) : int
Parameters
$args : Arguments

Console arguments instance.

$io : ConsoleIo

Console IO instance.

Return values
int

collectTableAliases()

Collect table aliases from the application or a plugin.

protected collectTableAliases([string|null $plugin = null ]) : array<string|int, string>
Parameters
$plugin : string|null = null

Plugin name when searching plugin tables.

Return values
array<string|int, string>

discoverActiveWindowTableAliases()

Discover table aliases whose entities extend ActiveWindowBaseEntity.

protected discoverActiveWindowTableAliases(TableLocator $tableLocator) : array<string|int, string>
Parameters
$tableLocator : TableLocator

Table locator instance.

Return values
array<string|int, string>

evaluateAlias()

Evaluate alias and append when entity inherits ActiveWindowBaseEntity.

protected evaluateAlias(TableLocator $tableLocator, array<string|int, string> $aliases, string $alias) : array<string|int, string>
Parameters
$tableLocator : TableLocator

Table locator instance.

$aliases : array<string|int, string>

Current alias list

$alias : string

Alias to evaluate

Return values
array<string|int, string>

synchronizeTable()

Synchronize statuses for a table whose entity extends ActiveWindowBaseEntity.

protected synchronizeTable(Table $table, FrozenTime $now, bool $dryRun, ConsoleIo $io) : array{upcoming_to_current: int, current_to_expired: int, errors: int}
Parameters
$table : Table

Target table instance.

$now : FrozenTime

Current timestamp reference.

$dryRun : bool

Whether to skip persistence.

$io : ConsoleIo

Console IO.

Return values
array{upcoming_to_current: int, current_to_expired: int, errors: int}

        
On this page

Search results