36 $this->db = $DIC->database();
70 $this->context_obj_id = $a_context_obj_id;
90 $this->context_obj_type = $a_context_obj_type;
110 $this->context_sub_obj_id = $a_context_sub_obj_id;
130 $this->context_sub_obj_type = $a_context_sub_obj_type;
170 $this->title = $a_title;
191 $this->
setId(
$ilDB->nextId(
"il_custom_block"));
192 $query =
"INSERT INTO il_custom_block (" .
195 ", context_obj_type" .
196 ", context_sub_obj_id" .
197 ", context_sub_obj_type" .
208 $ilDB->manipulate($query);
219 $query =
"SELECT * FROM il_custom_block WHERE id = " .
222 $rec =
$ilDB->fetchAssoc($set);
240 $query =
"UPDATE il_custom_block SET " .
247 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
256 public function delete()
260 $query =
"DELETE FROM il_custom_block" .
261 " WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
274 $query =
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title " .
275 "FROM il_custom_block " .
285 while ($rec =
$ilDB->fetchAssoc($set)) {
300 $query =
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title " .
301 "FROM il_custom_block " .
305 if ($a_include_sub_obj_id) {
313 while ($rec =
$ilDB->fetchAssoc($set)) {
327 die(
"ilCustomBlock::queryTitleForId is deprecated");
352 $query =
"SELECT count(*) as cnt " .
353 "FROM il_custom_block " .
359 " AND type = " .
$ilDB->quote($this->
getType(),
"text") .
"";
363 while ($rec =
$ilDB->fetchAssoc($set)) {
374 $ilDB = $DIC->database();
376 $query =
"SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title " .
377 "FROM il_custom_block " .
379 $ilDB->in(
"context_obj_id", $a_context_obj_ids,
"",
"integer") .
380 " AND context_obj_type = " .
$ilDB->quote($a_context_obj_type,
"text") .
384 while ($rec =
$ilDB->fetchAssoc($set)) {
queryBlocksForContext($a_include_sub_obj=true)
Query BlocksForContext.
setContextSubObjType($a_context_sub_obj_type)
Set ContextSubObjType.
setContextSubObjId($a_context_sub_obj_id)
Set ContextSubObjId.
read()
Read item from database.
static multiBlockQuery($a_context_obj_type, array $a_context_obj_ids)
setTitle($a_title)
Set Title.
setType($a_type)
Set Type.
getContextObjType()
Get ContextObjType.
querygetBlocksForContext()
Query getBlocksForContext.
getContextSubObjType()
Get ContextSubObjType.
queryTitleForId()
Query TitleForId.
__construct($a_id=0)
Constructor.
queryCntBlockForContext()
Query CntBlockForContext.
This is the super class of all custom blocks.
getContextSubObjId()
Get ContextSubObjId.
setContextObjType($a_context_obj_type)
Set ContextObjType.
getContextObjId()
Get ContextObjId.
setContextObjId($a_context_obj_id)
Set ContextObjId.
update()
Update item in database.