64 $this->context_obj_id = $a_context_obj_id;
84 $this->context_obj_type = $a_context_obj_type;
104 $this->context_sub_obj_id = $a_context_sub_obj_id;
124 $this->context_sub_obj_type = $a_context_sub_obj_type;
144 $this->type = $a_type;
164 $this->title = $a_title;
185 $this->
setId($ilDB->nextId(
"il_custom_block"));
186 $query =
"INSERT INTO il_custom_block (".
189 ", context_obj_type".
190 ", context_sub_obj_id".
191 ", context_sub_obj_type".
195 $ilDB->quote($this->
getId(),
"integer")
200 .
",".$ilDB->quote($this->
getType(),
"text")
201 .
",".$ilDB->quote($this->
getTitle(),
"text").
")";
202 $ilDB->manipulate($query);
213 $query =
"SELECT * FROM il_custom_block WHERE id = ".
214 $ilDB->quote($this->
getId(),
"integer");
215 $set = $ilDB->query(
$query);
216 $rec = $ilDB->fetchAssoc($set);
235 $query =
"UPDATE il_custom_block SET ".
236 " context_obj_id = ".$ilDB->quote($this->
getContextObjId(),
"integer").
240 ", type = ".$ilDB->quote($this->
getType(),
"text").
241 ", title = ".$ilDB->quote($this->
getTitle(),
"text").
242 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
244 $ilDB->manipulate(
$query);
252 public function delete()
256 $query =
"DELETE FROM il_custom_block".
257 " WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
259 $ilDB->manipulate(
$query);
271 $query =
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title ".
272 "FROM il_custom_block ".
280 $set = $ilDB->query(
$query);
282 while($rec = $ilDB->fetchAssoc($set))
299 $query =
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title ".
300 "FROM il_custom_block ".
304 if($a_include_sub_obj_id)
311 $set = $ilDB->query(
$query);
313 while($rec = $ilDB->fetchAssoc($set))
329 die(
"ilCustomBlock::queryTitleForId is deprecated");
354 $query =
"SELECT count(*) as cnt ".
355 "FROM il_custom_block ".
361 " AND type = ".$ilDB->quote($this->
getType(),
"text").
"";
363 $set = $ilDB->query(
$query);
365 while($rec = $ilDB->fetchAssoc($set))
377 $query =
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title ".
378 "FROM il_custom_block ".
380 $ilDB->in(
"context_obj_id", $a_context_obj_ids,
"",
"integer").
381 " AND context_obj_type = ".$ilDB->quote($a_context_obj_type,
"text").
383 $set = $ilDB->query(
$query);
385 while($rec = $ilDB->fetchAssoc($set))