| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxVps\Core\Tasks;
- use ModulesGarden\Servers\ProxmoxVps\Core\Models\Tasks\Task;
- class Job
- {
- /**
- * @var Task[]
- */
- protected $tasks = [];
- public function __construct()
- {
- }
- /**
- * Add single task
- * @param Task $task
- */
- final public function addTask(Task $task)
- {
- $this->tasks[] = $task;
- }
- /**
- * Add many tasks
- * @param $tasks
- */
- final public function addTasks($tasks)
- {
- foreach($this->tasks as $task)
- {
- $this->addTask($task);
- }
- }
- /**
- * Run some action on your tasks
- */
- public function run()
- {
- foreach($this->tasks as $task)
- {
- //$task->fi
- }
- }
- }
|