ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SyncTaskManager.php
Go to the documentation of this file.
1<?php
2
4
10
28{
29
33 protected $persistence;
34
35
37 {
38 $this->persistence = $persistence;
39 }
40
41
51 public function run(Bucket $bucket)
52 {
53 $task = $bucket->getTask();
54 $bucket->setCurrentTask($task);
55 $observer = new NonPersistingObserver($bucket);
56
57 try {
58 $this->executeTask($task, $observer);
59 $bucket->setState(State::FINISHED);
61 $bucket->setState(State::FINISHED);
63 // We're okay!
64 $this->persistence->saveBucketAndItsTasks($bucket);
65 }
66 }
67}
An exception for terminatinating execution or to throw for unit testing.
run(Bucket $bucket)
This will add an Observer of the Task and start running the task.
executeTask(Task $task, Observer $observer)
Actually executes a task.