Bristol SU Support Package
Public Member Functions | Private Attributes | List of all members
BristolSU\Support\ModuleInstance\Scheduler\CommandStore Class Reference
Inheritance diagram for BristolSU\Support\ModuleInstance\Scheduler\CommandStore:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\ModuleInstance\Scheduler\CommandStore:
Collaboration graph
[legend]

Public Member Functions

 schedule ($alias, $command, $cron)
 
 all ()
 
 forAlias (string $alias)
 

Private Attributes

 $commands = []
 

Detailed Description

Holds information about scheduled commands

Definition at line 10 of file CommandStore.php.

Member Function Documentation

◆ all()

BristolSU\Support\ModuleInstance\Scheduler\CommandStore::all ( )

Retrieve all scheduled commands

Returns
array ['module_alias' => [CommandName::class => 'cron', ...], ... ]

Implements BristolSU\Support\ModuleInstance\Contracts\Scheduler\CommandStore.

Definition at line 49 of file CommandStore.php.

References BristolSU\Support\ModuleInstance\Scheduler\CommandStore\$commands.

◆ forAlias()

BristolSU\Support\ModuleInstance\Scheduler\CommandStore::forAlias ( string  $alias)

Get all scheduled commands for a given module

Parameters
string$aliasAlias of the module
Returns
array [ CommandName::class => '* * * * *', ... ]

Implements BristolSU\Support\ModuleInstance\Contracts\Scheduler\CommandStore.

Definition at line 60 of file CommandStore.php.

◆ schedule()

BristolSU\Support\ModuleInstance\Scheduler\CommandStore::schedule (   $alias,
  $command,
  $cron 
)

Register a new scheduled command

Parameters
string$aliasModule alias registering the command
string$commandCommand to run
string$cronCron string to represent the frequency of the command running
Returns
void

Implements BristolSU\Support\ModuleInstance\Contracts\Scheduler\CommandStore.

Definition at line 36 of file CommandStore.php.

Member Data Documentation

◆ $commands

BristolSU\Support\ModuleInstance\Scheduler\CommandStore::$commands = []
private

The documentation for this class was generated from the following file: