3 declare(strict_types=1);
    38         if (count(
$data) == 0) {
    42             if (
$data[
'activation_start_ts']) {
    43                 $start = new \DateTime();
    44                 $start->setTimestamp((
int) 
$data[
'activation_start_ts']);
    49             if (
$data[
'activation_end_ts']) {
    50                 $end = new \DateTime();
    51                 $end->setTimestamp((
int) 
$data[
'activation_end_ts']);
    57                 (
int) 
$data[
'ref_id'],
    58                 (
bool) $data[
'online'],
    59                 (
bool) $data[
'effective_online'],
    70         $query = 
"DELETE FROM " . static::TABLE_NAME . PHP_EOL
    71             . 
"WHERE ref_id = " . $this->database->quote($ref_id, 
"integer") . PHP_EOL
    73         $this->database->manipulate($query);
    79             "ref_id" => [
"integer", $settings->
getRefId()]
    86             $start = $start->getTimestamp();
    90             $end = $end->getTimestamp();
    95             "activation_start_ts" => [
"integer", $start],
    96             "activation_end_ts" => [
"integer", $end]
    99         $this->database->update(static::TABLE_NAME, $values, $where);
   108             $start = $start->getTimestamp();
   112             $end = $end->getTimestamp();
   116             "ref_id" => [
"integer", $settings->
getRefId()],
   119             "activation_start_ts" => [
"integer", $start],
   120             "activation_end_ts" => [
"integer", $end]
   123         $this->database->insert(static::TABLE_NAME, $values);
   133              "SELECT ref_id, online, effective_online, activation_start_ts, activation_end_ts" . PHP_EOL
   134             . 
"FROM " . static::TABLE_NAME . PHP_EOL
   135             . 
"WHERE ref_id = " . $this->database->quote($ref_id, 
"integer") . PHP_EOL
   138         $result = $this->database->query($query);
   140         if ($this->database->numRows($result) !== 0) {
   141             $ret = $this->database->fetchAssoc($result);
   149         bool $online = 
false,
   150         bool $effective_online = 
false,
   165         $where = [
"ref_id" => [
"integer", 
$ref_id]];
   166         $values = [
"effective_online" => [
"integer", $status]];
   168         $this->database->update(static::TABLE_NAME, $values, $where);
 
setEffectiveOnlineStatus(int $ref_id, bool $status)
 
store(ilLearningSequenceActivation $settings)
 
deleteForRefId(int $ref_id)
 
buildActivationSettings(int $ref_id, bool $online=false, bool $effective_online=false, \DateTime $activation_start=null, \DateTime $activation_end=null)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(ilDBInterface $database)
 
getActivationForRefId(int $ref_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
insert(ilLearningSequenceActivation $settings)
 
getEffectiveOnlineStatus()