22 $this->db = (is_null(
$db))
35 public function get(
string $parent_type, array $ids,
bool $check_scheduled_activation =
false,
string $lang =
"")
48 foreach ($this->
getData($parent_type, $ids, $check_scheduled_activation,
"-") as $k => $v) {
53 foreach ($this->
getData($parent_type, $ids, $check_scheduled_activation,
$lang) as $k => $v) {
60 protected function getData(
string $parent_type, array $ids,
bool $check_scheduled_activation =
false,
string $lang =
"")
64 "SELECT page_id, active, activation_start, activation_end, show_activation_info FROM page_object WHERE " .
65 $db->in(
"page_id", $ids,
false,
"integer") .
66 " AND parent_type = %s AND lang = %s",
72 while ($rec =
$db->fetchAssoc($set)) {
73 if (!$rec[
"active"] && $check_scheduled_activation) {
74 if ($now >= $rec[
"activation_start"] &&
75 $now <= $rec[
"activation_end"]) {
76 $active[$rec[
"page_id"]] = [
78 "start" => $rec[
"activation_start"],
79 "end" => $rec[
"activation_end"],
80 "show_info" => (bool) $rec[
"show_activation_info"]
83 $active[$rec[
"page_id"]] = [
85 "start" => $rec[
"activation_start"],
86 "end" => $rec[
"activation_end"],
87 "show_info" => (bool) $rec[
"show_activation_info"]
91 $active[$rec[
"page_id"]] = [
92 "active" => (bool) $rec[
"active"],
An exception for terminatinating execution or to throw for unit testing.
__construct(\ilDBInterface $db=null)
Constructor.
getData(string $parent_type, array $ids, bool $check_scheduled_activation=false, string $lang="")
static now()
Return current timestamp in Y-m-d H:i:s format.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...