From a9ba3f039f02cce2aa241af37a5912b82441d05b Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 22 Jul 2020 16:51:38 +0200 Subject: [PATCH] Added new public method getJobsByTypeStatusInput to library JobsQueueLib --- application/libraries/JobsQueueLib.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/application/libraries/JobsQueueLib.php b/application/libraries/JobsQueueLib.php index c37d800a7..0eb7c9b72 100644 --- a/application/libraries/JobsQueueLib.php +++ b/application/libraries/JobsQueueLib.php @@ -56,6 +56,18 @@ class JobsQueueLib return $this->_ci->JobsQueueModel->loadWhere(array('status' => self::STATUS_NEW, 'type' => $type)); } + /** + * To get all the jobs specified by the given parameters + */ + public function getJobsByTypeStatusInput($type, $status, $input) + { + $this->_ci->JobsQueueModel->resetQuery(); + + $this->_ci->JobsQueueModel->addOrder('creationtime', 'DESC'); + + return $this->_ci->JobsQueueModel->loadWhere(array('status' => $status, 'type' => $type, 'input' => $input)); + } + /** * Add new jobs in the jobs queue with the given type * jobs is an array of job objects