3 declare(strict_types=1);
27 if (count(
$data) == 0) {
31 if (
$data[
'activation_start_ts']) {
33 $start->setTimestamp((
int)
$data[
'activation_start_ts']);
38 if (
$data[
'activation_end_ts']) {
39 $end = new \DateTime();
40 $end->setTimestamp((
int)
$data[
'activation_end_ts']);
46 (
int)
$data[
'ref_id'],
47 (
bool) $data[
'online'],
48 (
bool) $data[
'effective_online'],
60 .
"WHERE ref_id = " . $this->database->quote($ref_id,
"integer") .
PHP_EOL 62 $this->database->manipulate(
$query);
68 "ref_id" => array(
"integer", $settings->
getRefId())
81 "online" => array(
"integer", $settings->
getIsOnline()),
82 "activation_start_ts" => array(
"integer",
$start),
83 "activation_end_ts" => array(
"integer",
$end)
85 $this->database->update(static::TABLE_NAME,
$values, $where);
99 "ref_id" => array(
"integer", $settings->
getRefId()),
100 "online" => array(
"integer", $settings->
getIsOnline()),
102 "activation_start_ts" => array(
"integer",
$start),
103 "activation_end_ts" => array(
"integer",
$end)
105 $this->database->insert(static::TABLE_NAME,
$values);
108 protected function select(
int $ref_id) : array
112 "SELECT ref_id, online, effective_online, activation_start_ts, activation_end_ts" .
PHP_EOL 113 .
"FROM " . static::TABLE_NAME .
PHP_EOL 114 .
"WHERE ref_id = " . $this->database->quote($ref_id,
"integer") .
PHP_EOL 119 if (
$result->numRows() !== 0) {
128 bool $online =
false,
129 bool $effective_online =
false,
145 "ref_id" => array(
"integer", $ref_id)
149 "effective_online" => array(
"integer", $status),
152 $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)
Activation-Settings for an LSO.
__construct(ilDBInterface $database)
getActivationForRefId(int $ref_id)
Persistence for online/activation period.
insert(ilLearningSequenceActivation $settings)
getEffectiveOnlineStatus()