diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-04-24 14:38:41 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-04-24 14:40:49 +0200 |
commit | b31dc10c3c4b73b08c926751effbade601c7cab8 (patch) | |
tree | 3a8cf49470008b5ac87333fd9e4523735210e953 /lib/backgroundjob | |
parent | 117412272e34f73b9e9f69e1261b0d353dc12393 (diff) | |
download | nextcloud-server-b31dc10c3c4b73b08c926751effbade601c7cab8.tar.gz nextcloud-server-b31dc10c3c4b73b08c926751effbade601c7cab8.zip |
Add support for the old public backgroundjob api
Diffstat (limited to 'lib/backgroundjob')
-rw-r--r-- | lib/backgroundjob/job.php | 4 | ||||
-rw-r--r-- | lib/backgroundjob/joblist.php | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/backgroundjob/job.php b/lib/backgroundjob/job.php index aab3b8e4a64..49fbffbd684 100644 --- a/lib/backgroundjob/job.php +++ b/lib/backgroundjob/job.php @@ -42,4 +42,8 @@ abstract class Job { public function getLastRun() { return $this->lastRun; } + + public function getArgument() { + return $this->argument; + } } diff --git a/lib/backgroundjob/joblist.php b/lib/backgroundjob/joblist.php index 7471f84153b..cc803dd9b5f 100644 --- a/lib/backgroundjob/joblist.php +++ b/lib/backgroundjob/joblist.php @@ -111,6 +111,20 @@ class JobList { } /** + * @param int $id + * @return Job + */ + public function getById($id) { + $query = \OC_DB::prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` WHERE `id` = ?'); + $result = $query->execute(array($id)); + if ($row = $result->fetchRow()) { + return $this->buildJob($row); + } else { + return null; + } + } + + /** * get the job object from a row in the db * * @param array $row |