| 1 | <?php |
||
| 4 | class JobCollection implements \Countable |
||
| 5 | { |
||
| 6 | /** |
||
| 7 | * @var array |
||
| 8 | */ |
||
| 9 | private $jobs; |
||
| 10 | |||
| 11 | 7 | public function __construct() |
|
| 15 | |||
| 16 | /** |
||
| 17 | * @param JobHandlerInterface $job |
||
| 18 | */ |
||
| 19 | 5 | public function add(JobHandlerInterface $job) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @param array $jobs |
||
| 26 | * @return int count of added jobs |
||
| 27 | */ |
||
| 28 | 2 | public function addMultipleJobs(array $jobs) |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @return JobHandlerInterface[] |
||
| 47 | */ |
||
| 48 | 4 | public function getJobs() |
|
| 52 | |||
| 53 | /** |
||
| 54 | * @param $jobName |
||
| 55 | * @return JobHandlerInterface|null |
||
| 56 | */ |
||
| 57 | public function getJob($jobName) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return int |
||
| 71 | */ |
||
| 72 | 7 | public function count() |
|
| 76 | } |
||
| 77 |