| 1 | <?php |
||
| 23 | class JobCollection |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var array |
||
| 27 | * |
||
| 28 | * All jobs from worker |
||
| 29 | */ |
||
| 30 | private $workerJobs = array(); |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Adds into $workerJobs a Job instance |
||
| 34 | * Return self object |
||
| 35 | * |
||
| 36 | * @param Job $workJob Class to add into array |
||
| 37 | * |
||
| 38 | * @return JobCollection |
||
| 39 | */ |
||
| 40 | public function add(Job $workJob) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Retrieve all Jobs added previously |
||
| 49 | * |
||
| 50 | * @return array |
||
| 51 | */ |
||
| 52 | public function getJobs() |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Retrieve all jobs loaded previously in cache format |
||
| 59 | * |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | 3 | public function toArray() |
|
| 73 | } |
||
| 74 |