Bristol SU Support Package
src
ModuleInstance
Scheduler
CommandStore.php
Go to the documentation of this file.
1
<?php
2
3
namespace
BristolSU\Support\ModuleInstance\Scheduler
;
4
5
use
BristolSU\Support\ModuleInstance\Contracts\Scheduler\CommandStore
as
CommandStoreContract
;
6
10
class
CommandStore
implements
CommandStoreContract
11
{
12
25
private
$commands
= [];
26
36
public
function
schedule
($alias, $command, $cron)
37
{
38
if
(!array_key_exists($alias, $this->commands)) {
39
$this->commands[$alias] = [];
40
}
41
$this->commands[$alias][$command] = $cron;
42
}
43
49
public
function
all
()
50
{
51
return
$this->commands
;
52
}
53
60
public
function
forAlias
(
string
$alias)
61
{
62
return
(isset($this->commands, $alias) ?
63
$this->commands[$alias] : []);
64
}
65
66
}
BristolSU\Support\ModuleInstance\Scheduler\CommandStore\forAlias
forAlias(string $alias)
Definition:
CommandStore.php:60
BristolSU\Support\ModuleInstance\Scheduler\CommandStore\schedule
schedule($alias, $command, $cron)
Definition:
CommandStore.php:36
BristolSU\Support\ModuleInstance\Scheduler\CommandStore
Definition:
CommandStore.php:10
BristolSU\Support\ModuleInstance\Scheduler\CommandStore\all
all()
Definition:
CommandStore.php:49
CommandStore
BristolSU\Support\ModuleInstance\Scheduler
Definition:
CommandStore.php:3
BristolSU\Support\ModuleInstance\Scheduler\CommandStore\$commands
$commands
Definition:
CommandStore.php:25
Generated by
1.8.13