61 $this->log->debug(
"Handler ID: ".$handler_id);
64 include_once
"Services/BackgroundTask/classes/class.".$handler_id.
".php";
65 return $handler_id::getInstanceFromTask($this);
75 $set =
$ilDB->query(
"SELECT id FROM ".self::DB_NAME.
76 " WHERE user_id = ".
$ilDB->quote($a_user_id,
"integer").
77 " AND status = ".$ilDB->quote(self::STATUS_PROCESSING,
"text"));
89 return ($this->
getStatus() == self::STATUS_CANCELLING);
114 $this->handler = $a_val;
134 $this->
id = (int)$a_val;
154 $this->user_id = (int)$a_val;
174 $this->start_date = $a_val;
190 self::STATUS_INITIALIZED,
191 self::STATUS_PROCESSING,
192 self::STATUS_CANCELLING,
193 self::STATUS_CANCELLED,
194 self::STATUS_PROCESSED,
195 self::STATUS_FINISHED,
209 $this->status = $a_val;
230 $this->steps = abs($a_val);
250 $this->current_step = min(abs($a_val), $this->
getSteps());
270 $this->params = $a_params;
302 public function delete()
320 $set =
$ilDB->queryF(
321 "SELECT * FROM " . self::DB_NAME .
" WHERE id=%s",
325 while ($rec =
$ilDB->fetchAssoc($set))
337 ? unserialize($rec[
"params"])
345 "user_id" => array(
"integer", $this->
getUserId()),
347 "status" => array(
"text", $this->
getStatus()),
348 "steps" => array(
"integer", $this->
getSteps()),
351 "params" => array(
"string", is_array($this->
getParams())
361 $this->
setId($ilDB->nextId(self::DB_NAME));
365 $fields[
"id"] = array(
"integer", $this->
getId());
367 $ilDB->insert(self::DB_NAME, $fields);
379 array(
"id" => array(
"integer", $this->
getId()))
390 return $ilDB->manipulateF(
391 "DELETE FROM " . self::DB_NAME .
" WHERE id=%s",
393 array($this->
getId()));
An exception for terminatinating execution or to throw for unit testing.
setStartDate(ilDateTime $a_val)
Sets the date when the download was started.
doDelete()
Deletes the object from the database.
getSteps()
Gets the steps.
setSteps($a_val)
Sets the steps.
static getActiveByUserId($a_user_id)
getStatus()
Gets the status.
setId($a_val)
Sets the id.
getStartDate()
Gets the date when the download was started.
getCurrentStep()
Gets the current step.
setUserId($a_val)
Sets the user id.
setHandlerId($a_val)
Sets the handler id.
getUserId()
Gets the user id.
getParams()
Gets the params.
__construct($a_id=0)
Constructor.
setStatus($a_val)
Sets the status.
setParams(array $a_params=null)
Sets the params.
setCurrentStep($a_val)
Sets the current step.
exists()
Gets whether the download object exists.
getHandlerId()
Gets the handler.
@classDescription Date and time handling
static getLogger($a_component_id)
Get component logger.