ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCustomBlock Class Reference

This is the super class of all custom blocks. More...

+ Inheritance diagram for ilCustomBlock:
+ Collaboration diagram for ilCustomBlock:

Public Member Functions

 __construct ($a_id=0)
 Constructor.
 setId ($a_id)
 Set Id.
 getId ()
 Get Id.
 setContextObjId ($a_context_obj_id)
 Set ContextObjId.
 getContextObjId ()
 Get ContextObjId.
 setContextObjType ($a_context_obj_type)
 Set ContextObjType.
 getContextObjType ()
 Get ContextObjType.
 setContextSubObjId ($a_context_sub_obj_id)
 Set ContextSubObjId.
 getContextSubObjId ()
 Get ContextSubObjId.
 setContextSubObjType ($a_context_sub_obj_type)
 Set ContextSubObjType.
 getContextSubObjType ()
 Get ContextSubObjType.
 setType ($a_type)
 Set Type.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 create ()
 Create new item.
 read ()
 Read item from database.
 update ()
 Update item in database.
 delete ()
 Delete item from database.
 querygetBlocksForContext ()
 Query getBlocksForContext.
 queryBlocksForContext ($a_include_sub_obj=true)
 Query BlocksForContext.
 queryTitleForId ()
 Query TitleForId.
 queryCntBlockForContext ()
 Query CntBlockForContext.

Static Public Member Functions

static multiBlockQuery ($a_context_obj_type, array $a_context_obj_ids)

Protected Attributes

 $id
 $context_obj_id
 $context_obj_type
 $context_sub_obj_id
 $context_sub_obj_type
 $type
 $title

Detailed Description

This is the super class of all custom blocks.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilCustomBlock.php.

Constructor & Destructor Documentation

ilCustomBlock::__construct (   $a_id = 0)

Constructor.

Parameters
int$a_id

Reimplemented in ilExternalFeedBlock.

Definition at line 27 of file class.ilCustomBlock.php.

References read(), and setId().

{
if ($a_id > 0)
{
$this->setId($a_id);
$this->read();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilCustomBlock::create ( )

Create new item.

Reimplemented in ilExternalFeedBlock.

Definition at line 181 of file class.ilCustomBlock.php.

References $ilDB, $query, getContextObjId(), getContextObjType(), getContextSubObjId(), getContextSubObjType(), getId(), getTitle(), getType(), and setId().

{
global $ilDB;
$this->setId($ilDB->nextId("il_custom_block"));
$query = "INSERT INTO il_custom_block (".
" id".
", context_obj_id".
", context_obj_type".
", context_sub_obj_id".
", context_sub_obj_type".
", type".
", title".
" ) VALUES (".
$ilDB->quote($this->getId(), "integer")
.",".$ilDB->quote($this->getContextObjId(), "integer")
.",".$ilDB->quote($this->getContextObjType(), "text")
.",".$ilDB->quote($this->getContextSubObjId(), "integer")
.",".$ilDB->quote($this->getContextSubObjType(), "text")
.",".$ilDB->quote($this->getType(), "text")
.",".$ilDB->quote($this->getTitle(), "text").")";
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

ilCustomBlock::delete ( )

Delete item from database.

Reimplemented in ilExternalFeedBlock.

Definition at line 252 of file class.ilCustomBlock.php.

References $ilDB, $query, and getId().

{
global $ilDB;
$query = "DELETE FROM il_custom_block".
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

ilCustomBlock::getContextObjId ( )

Get ContextObjId.

Returns
int

Definition at line 72 of file class.ilCustomBlock.php.

References $context_obj_id.

Referenced by create(), queryBlocksForContext(), queryCntBlockForContext(), querygetBlocksForContext(), and update().

{
return (int) $this->context_obj_id;
}

+ Here is the caller graph for this function:

ilCustomBlock::getContextObjType ( )

Get ContextObjType.

Returns
int

Definition at line 92 of file class.ilCustomBlock.php.

References $context_obj_type.

Referenced by create(), queryBlocksForContext(), queryCntBlockForContext(), querygetBlocksForContext(), and update().

+ Here is the caller graph for this function:

ilCustomBlock::getContextSubObjId ( )

Get ContextSubObjId.

Returns
int

Definition at line 112 of file class.ilCustomBlock.php.

References $context_sub_obj_id.

Referenced by create(), queryBlocksForContext(), queryCntBlockForContext(), querygetBlocksForContext(), and update().

{
}

+ Here is the caller graph for this function:

ilCustomBlock::getContextSubObjType ( )

Get ContextSubObjType.

Returns
int

Definition at line 132 of file class.ilCustomBlock.php.

References $context_sub_obj_type.

Referenced by create(), queryBlocksForContext(), queryCntBlockForContext(), querygetBlocksForContext(), and update().

+ Here is the caller graph for this function:

ilCustomBlock::getId ( )

Get Id.

Returns
int

Definition at line 52 of file class.ilCustomBlock.php.

References $id.

Referenced by ilExternalFeedBlock\create(), create(), ilExternalFeedBlock\delete(), delete(), ilExternalFeedBlock\read(), read(), ilExternalFeedBlock\update(), and update().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilCustomBlock::getTitle ( )

Get Title.

Returns
string Title of block

Definition at line 172 of file class.ilCustomBlock.php.

References $title.

Referenced by create(), and update().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilCustomBlock::getType ( )

Get Type.

Returns
string Type of block.

Definition at line 152 of file class.ilCustomBlock.php.

References $type.

Referenced by create(), queryCntBlockForContext(), and update().

{
return $this->type;
}

+ Here is the caller graph for this function:

static ilCustomBlock::multiBlockQuery (   $a_context_obj_type,
array  $a_context_obj_ids 
)
static

Definition at line 373 of file class.ilCustomBlock.php.

References $ilDB, $query, and $result.

{
global $ilDB;
$query = "SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title ".
"FROM il_custom_block ".
"WHERE ".
$ilDB->in("context_obj_id", $a_context_obj_ids, "", "integer").
" AND context_obj_type = ".$ilDB->quote($a_context_obj_type, "text").
" ORDER BY title";
$set = $ilDB->query($query);
$result = array();
while($rec = $ilDB->fetchAssoc($set))
{
$result[] = $rec;
}
return $result;
}
ilCustomBlock::queryBlocksForContext (   $a_include_sub_obj = true)

Query BlocksForContext.

Definition at line 295 of file class.ilCustomBlock.php.

References $ilDB, $query, $result, getContextObjId(), getContextObjType(), getContextSubObjId(), and getContextSubObjType().

{
global $ilDB;
$query = "SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title ".
"FROM il_custom_block ".
"WHERE ".
"context_obj_id = ".$ilDB->quote($this->getContextObjId(), "integer").
" AND context_obj_type = ".$ilDB->quote($this->getContextObjType(), "text");
if($a_include_sub_obj_id)
{
$query .= " AND context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId(), "integer").
" AND ".$ilDB->equals("context_sub_obj_type", $this->getContextSubObjType(), "text", true);
//" AND context_sub_obj_type = ".$ilDB->quote($this->getContextSubObjType(), "text")."";
}
//echo "$query";
$set = $ilDB->query($query);
$result = array();
while($rec = $ilDB->fetchAssoc($set))
{
$result[] = $rec;
}
return $result;
}

+ Here is the call graph for this function:

ilCustomBlock::queryCntBlockForContext ( )

Query CntBlockForContext.

Definition at line 350 of file class.ilCustomBlock.php.

References $ilDB, $query, $result, getContextObjId(), getContextObjType(), getContextSubObjId(), getContextSubObjType(), and getType().

{
global $ilDB;
$query = "SELECT count(*) as cnt ".
"FROM il_custom_block ".
"WHERE ".
"context_obj_id = ".$ilDB->quote($this->getContextObjId(), "integer").
" AND context_obj_type = ".$ilDB->quote($this->getContextObjType(), "text").
" AND context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId(), "integer").
" AND ".$ilDB->equals("context_sub_obj_type", $this->getContextSubObjType(), "text", true).
" AND type = ".$ilDB->quote($this->getType(), "text")."";
$set = $ilDB->query($query);
$result = array();
while($rec = $ilDB->fetchAssoc($set))
{
$result[] = $rec;
}
return $result;
}

+ Here is the call graph for this function:

ilCustomBlock::querygetBlocksForContext ( )

Query getBlocksForContext.

Definition at line 267 of file class.ilCustomBlock.php.

References $ilDB, $query, $result, getContextObjId(), getContextObjType(), getContextSubObjId(), and getContextSubObjType().

{
global $ilDB;
$query = "SELECT id, context_obj_id, context_obj_type, context_sub_obj_id, context_sub_obj_type, type, title ".
"FROM il_custom_block ".
"WHERE ".
"context_obj_id = ".$ilDB->quote($this->getContextObjId(), "integer").
" AND context_obj_type = ".$ilDB->quote($this->getContextObjType(), "text").
" AND context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId(), "integer").
" AND ".$ilDB->equals("context_sub_obj_type", $this->getContextSubObjType(), "text", true);
//" AND context_sub_obj_type = ".$ilDB->quote($this->getContextSubObjType(), "text")."";
$set = $ilDB->query($query);
$result = array();
while($rec = $ilDB->fetchAssoc($set))
{
$result[] = $rec;
}
return $result;
}

+ Here is the call graph for this function:

ilCustomBlock::queryTitleForId ( )

Query TitleForId.

Definition at line 326 of file class.ilCustomBlock.php.

References $ilDB.

{
global $ilDB;
die("ilCustomBlock::queryTitleForId is deprecated");
/*
$query = "SELECT id ".
"FROM il_custom_block ".
"WHERE "."";
$set = $ilDB->query($query);
$result = array();
while($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$result[] = $rec;
}
return $result;
*/
}
ilCustomBlock::read ( )

Read item from database.

Reimplemented in ilExternalFeedBlock.

Definition at line 209 of file class.ilCustomBlock.php.

References $ilDB, $query, getId(), setContextObjId(), setContextObjType(), setContextSubObjId(), setContextSubObjType(), setTitle(), and setType().

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM il_custom_block WHERE id = ".
$ilDB->quote($this->getId(), "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->setContextObjId($rec["context_obj_id"]);
$this->setContextObjType($rec["context_obj_type"]);
$this->setContextSubObjId($rec["context_sub_obj_id"]);
$this->setContextSubObjType($rec["context_sub_obj_type"]);
$this->setType($rec["type"]);
$this->setTitle($rec["title"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCustomBlock::setContextObjId (   $a_context_obj_id)

Set ContextObjId.

Parameters
int$a_context_obj_id

Definition at line 62 of file class.ilCustomBlock.php.

Referenced by read().

{
$this->context_obj_id = $a_context_obj_id;
}

+ Here is the caller graph for this function:

ilCustomBlock::setContextObjType (   $a_context_obj_type)

Set ContextObjType.

Parameters
int$a_context_obj_type

Definition at line 82 of file class.ilCustomBlock.php.

Referenced by read().

{
$this->context_obj_type = $a_context_obj_type;
}

+ Here is the caller graph for this function:

ilCustomBlock::setContextSubObjId (   $a_context_sub_obj_id)

Set ContextSubObjId.

Parameters
int$a_context_sub_obj_id

Definition at line 102 of file class.ilCustomBlock.php.

Referenced by read().

{
$this->context_sub_obj_id = $a_context_sub_obj_id;
}

+ Here is the caller graph for this function:

ilCustomBlock::setContextSubObjType (   $a_context_sub_obj_type)

Set ContextSubObjType.

Parameters
int$a_context_sub_obj_type

Definition at line 122 of file class.ilCustomBlock.php.

Referenced by read().

{
$this->context_sub_obj_type = $a_context_sub_obj_type;
}

+ Here is the caller graph for this function:

ilCustomBlock::setId (   $a_id)

Set Id.

Parameters
int$a_id

Definition at line 42 of file class.ilCustomBlock.php.

Referenced by ilExternalFeedBlock\__construct(), __construct(), and create().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilCustomBlock::setTitle (   $a_title)

Set Title.

Parameters
string$a_titleTitle of block

Definition at line 162 of file class.ilCustomBlock.php.

Referenced by read().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilCustomBlock::setType (   $a_type)

Set Type.

Parameters
string$a_typeType of block.

Definition at line 142 of file class.ilCustomBlock.php.

Referenced by read().

{
$this->type = $a_type;
}

+ Here is the caller graph for this function:

ilCustomBlock::update ( )

Update item in database.

Reimplemented in ilExternalFeedBlock.

Definition at line 231 of file class.ilCustomBlock.php.

References $ilDB, $query, getContextObjId(), getContextObjType(), getContextSubObjId(), getContextSubObjType(), getId(), getTitle(), and getType().

{
global $ilDB;
$query = "UPDATE il_custom_block SET ".
" context_obj_id = ".$ilDB->quote($this->getContextObjId(), "integer").
", context_obj_type = ".$ilDB->quote($this->getContextObjType(), "text").
", context_sub_obj_id = ".$ilDB->quote($this->getContextSubObjId(), "integer").
", context_sub_obj_type = ".$ilDB->quote($this->getContextSubObjType(), "text").
", type = ".$ilDB->quote($this->getType(), "text").
", title = ".$ilDB->quote($this->getTitle(), "text").
" WHERE id = ".$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($query);
}

+ Here is the call graph for this function:

Field Documentation

ilCustomBlock::$context_obj_id
protected

Definition at line 15 of file class.ilCustomBlock.php.

Referenced by getContextObjId().

ilCustomBlock::$context_obj_type
protected

Definition at line 16 of file class.ilCustomBlock.php.

Referenced by getContextObjType().

ilCustomBlock::$context_sub_obj_id
protected

Definition at line 17 of file class.ilCustomBlock.php.

Referenced by getContextSubObjId().

ilCustomBlock::$context_sub_obj_type
protected

Definition at line 18 of file class.ilCustomBlock.php.

Referenced by getContextSubObjType().

ilCustomBlock::$id
protected

Definition at line 14 of file class.ilCustomBlock.php.

Referenced by getId().

ilCustomBlock::$title
protected

Definition at line 20 of file class.ilCustomBlock.php.

Referenced by getTitle().

ilCustomBlock::$type
protected

Definition at line 19 of file class.ilCustomBlock.php.

Referenced by getType().


The documentation for this class was generated from the following file: