3 declare(strict_types=1);
    28     protected int $id = 0;
    41         $this->db = $DIC->database();
    48     public function setId(
int $a_id): void
    60         $this->context_obj_id = $a_context_obj_id;
    70         $this->context_obj_type = $a_context_obj_type;
    80         $this->context_sub_obj_id = $a_context_sub_obj_id;
    90         $this->context_sub_obj_type = $a_context_sub_obj_type;
   103         $this->type = $a_type;
   113         $this->title = $a_title;
   125         $this->
setId(
$ilDB->nextId(
"il_custom_block"));
   126         $query = 
"INSERT INTO il_custom_block (" .
   129             ", context_obj_type" .
   130             ", context_sub_obj_id" .
   131             ", context_sub_obj_type" .
   142         $ilDB->manipulate($query);
   149         $query = 
"SELECT * FROM il_custom_block WHERE id = " .
   151         $set = 
$ilDB->query($query);
   152         $rec = 
$ilDB->fetchAssoc($set);
   159         $this->
setTitle((
string) $rec[
"title"]);
   166         $query = 
"UPDATE il_custom_block SET " .
   173             " WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
   175         $ilDB->manipulate($query);
   178     public function delete(): 
void   182         $query = 
"DELETE FROM il_custom_block" .
   183             " WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
   185         $ilDB->manipulate($query);
   192         bool $a_include_sub_obj = 
true   196         $query = 
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title " .
   197             "FROM il_custom_block " .
   201         if ($a_include_sub_obj) {
   207         $set = 
$ilDB->query($query);
   209         while ($rec = 
$ilDB->fetchAssoc($set)) {
   220         $query = 
"SELECT count(*) as cnt " .
   221             "FROM il_custom_block " .
   227                 " AND type = " . 
$ilDB->quote($this->
getType(), 
"text");
   229         $set = 
$ilDB->query($query);
   231         while ($rec = 
$ilDB->fetchAssoc($set)) {
   239         string $a_context_obj_type,
   240         array $a_context_obj_ids
   244         $ilDB = $DIC->database();
   246         $query = 
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title " .
   247             "FROM il_custom_block " .
   249                 $ilDB->in(
"context_obj_id", $a_context_obj_ids, 
false, 
"integer") .
   250                 " AND context_obj_type = " . 
$ilDB->quote($a_context_obj_type, 
"text") .
   252         $set = 
$ilDB->query($query);
   254         while ($rec = 
$ilDB->fetchAssoc($set)) {
 
setTitle(string $a_title)
 
string $context_sub_obj_type
 
setContextObjId(int $a_context_obj_id)
 
setContextSubObjId(int $a_context_sub_obj_id)
 
setContextSubObjType(string $a_context_sub_obj_type)
 
queryBlocksForContext(bool $a_include_sub_obj=true)
Query BlocksForContext. 
 
queryCntBlockForContext()
 
setContextObjType(string $a_context_obj_type)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static multiBlockQuery(string $a_context_obj_type, array $a_context_obj_ids)