19 declare(strict_types=1);
40 $this->obj_type = $a_obj_type;
41 $this->db = $DIC->database();
47 if (self::$instance) {
48 return self::$instance;
67 $db = $DIC->database();
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);
static lookupAssignedObjectTypes()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static ilDidacticTemplateSettings $instance
__construct(string $a_obj_type='')
read()
Read active didactic templates.
query(string $query)
Run a (read-only) Query on the database.
static getInstanceByObjectType(string $a_obj_type)
readInactive()
Read disabled templates.