19declare(strict_types=1);
40 $this->obj_type = $a_obj_type;
41 $this->db =
$DIC->database();
47 if (self::$instance) {
68 $query =
'select distinct (obj_type) from didactic_tpl_sa ' .
73 $types[] = $row->obj_type;
97 $query =
'SELECT dtpl.id FROM didactic_tpl_settings dtpl ';
100 $query .=
'JOIN didactic_tpl_sa tplsa ON dtpl.id = tplsa.id ';
102 $query .=
'WHERE enabled = ' . $this->db->quote(0,
'integer') .
' ';
105 $query .=
'AND obj_type = ' . $this->db->quote($this->
getObjectType(),
'text');
108 $res = $this->db->query($query);
120 protected function read(): bool
122 $query =
'SELECT dtpl.id FROM didactic_tpl_settings dtpl ';
124 $query .=
'JOIN didactic_tpl_sa tplsa ON dtpl.id = tplsa.id ';
126 $query .=
'WHERE enabled = ' . $this->db->quote(1,
'integer') .
' ';
129 $query .=
'AND obj_type = ' . $this->db->quote($this->
getObjectType(),
'text');
131 $res = $this->db->query($query);
read()
Read active didactic templates.
static ilDidacticTemplateSettings $instance
readInactive()
Read disabled templates.
__construct(string $a_obj_type='')
static lookupAssignedObjectTypes()
static getInstanceByObjectType(string $a_obj_type)
query(string $query)
Run a (read-only) Query on the database.