*/
private $visitorInstance = NULL;
+ /**
+ * Instance of the list
+ */
+ private $listInstance = NULL;
+
/**
* Protected constructor
*
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
*/
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;