]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/handler/tasks/class_TaskHandler.php
Continued:
[core.git] / framework / main / classes / handler / tasks / class_TaskHandler.php
index c6b893d3670fecd142f256b19f46d6912be41066..dfdff9a295f6dba459b040ba8841ce83d12ab842 100644 (file)
@@ -43,6 +43,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        private $visitorInstance = NULL;
 
+       /**
+        * Instance of the list
+        */
+       private $listInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -107,6 +112,25 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                return $this->visitorInstance;
        }
 
+       /**
+        * Setter for the list instance
+        *
+        * @param       $listInstance   A list of Listable
+        * @return      void
+        */
+       protected final function setListInstance (Listable $listInstance) {
+               $this->listInstance = $listInstance;
+       }
+
+       /**
+        * Getter for the list instance
+        *
+        * @return      $listInstance   A list of Listable
+        */
+       protected final function getListInstance () {
+               return $this->listInstance;
+       }
+
        /**
         * Tries to execute the given task. If as task should not be started (yet)
         * or the interval time (see task_interval_delay) is not yet reached the
@@ -305,7 +329,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        public function hasTasksLeft () {
                // Do we have tasks there?
-               $tasksLeft = (($this->getListInstance() instanceof Listable) && ($this->getListInstance()->count() > 0));
+               $tasksLeft = ($this->getListInstance()->count() > 0);
 
                // Return result
                return $tasksLeft;