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/joblist.php | |
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/joblist.php')
-rw-r--r-- | lib/backgroundjob/joblist.php | 14 |
1 files changed, 14 insertions, 0 deletions
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 |