60 $this->log->debug(
"Handler ID: " . $handler_id);
62 include_once
"Services/BackgroundTask/classes/class." . $handler_id .
".php";
63 return $handler_id::getInstanceFromTask($this);
74 $set =
$ilDB->query(
"SELECT id FROM " . self::DB_NAME .
75 " WHERE user_id = " .
$ilDB->quote($a_user_id,
"integer") .
76 " AND status = " .
$ilDB->quote(self::STATUS_PROCESSING,
"text"));
87 return ($this->
getStatus() == self::STATUS_CANCELLING);
112 $this->handler = $a_val;
132 $this->
id = (int) $a_val;
152 $this->user_id = (int) $a_val;
172 $this->start_date = $a_val;
188 self::STATUS_INITIALIZED,
189 self::STATUS_PROCESSING,
190 self::STATUS_CANCELLING,
191 self::STATUS_CANCELLED,
192 self::STATUS_PROCESSED,
193 self::STATUS_FINISHED,
206 $this->status = $a_val;
227 $this->steps = abs($a_val);
247 $this->current_step = min(abs($a_val), $this->
getSteps());
267 $this->params = $a_params;
296 public function delete()
310 $ilDB = $DIC[
'ilDB'];
314 $set =
$ilDB->queryF(
315 "SELECT * FROM " . self::DB_NAME .
" WHERE id=%s",
320 while ($rec =
$ilDB->fetchAssoc($set)) {
331 ? unserialize($rec[
"params"])
339 "user_id" => array(
"integer", $this->
getUserId()),
341 "status" => array(
"text", $this->
getStatus()),
342 "steps" => array(
"integer", $this->
getSteps()),
345 "params" => array(
"string", is_array($this->
getParams())
354 $ilDB = $DIC[
'ilDB'];
360 $fields[
"id"] = array(
"integer", $this->
getId());
362 $ilDB->insert(self::DB_NAME, $fields);
370 $ilDB = $DIC[
'ilDB'];
375 array(
"id" => array(
"integer", $this->
getId()))
385 $ilDB = $DIC[
'ilDB'];
387 return $ilDB->manipulateF(
388 "DELETE FROM " . self::DB_NAME .
" WHERE id=%s",
390 array($this->
getId())
setStatus($a_val)
Sets the status.
setStartDate(ilDateTime $a_val)
Sets the date when the download was started.
getSteps()
Gets the steps.
setCurrentStep($a_val)
Sets the current step.
getParams()
Gets the params.
__construct($a_id=0)
Constructor.
static getActiveByUserId($a_user_id)
getStartDate()
Gets the date when the download was started.
setHandlerId($a_val)
Sets the handler id.
setId($a_val)
Sets the id.
foreach($_POST as $key=> $value) $res
getCurrentStep()
Gets the current step.
getHandlerId()
Gets the handler.
setParams(array $a_params=null)
Sets the params.
exists()
Gets whether the download object exists.
setSteps($a_val)
Sets the steps.
static getLogger($a_component_id)
Get component logger.
getStatus()
Gets the status.
doDelete()
Deletes the object from the database.
getUserId()
Gets the user id.
setUserId($a_val)
Sets the user id.