ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMediaPoolItem Class Reference

Media Pool Item. More...

+ Collaboration diagram for ilMediaPoolItem:

Public Member Functions

 __construct ($a_id=0)
 Construtor.
 setId ($a_val)
 Set id.
 getId ()
 Get id.
 setType ($a_val)
 Set type.
 getType ()
 Get type.
 setForeignId ($a_val)
 Set foreign id.
 getForeignId ()
 Get foreign id.
 setTitle ($a_val)
 Set title.
 getTitle ()
 Get title.
 create ()
 Create.
 read ()
 Read.
 update ()
 Update.
 delete ()
 Delete.

Static Public Member Functions

static lookupForeignId ($a_id)
 Lookup Foreign Id.
static lookupType ($a_id)
 Lookup type.
static lookupTitle ($a_id)
 Lookup title.
static updateObjectTitle ($a_obj)
 Update object title.
static getPoolForItemId ($a_id)
 Get media pools for item id.

Static Private Member Functions

static lookup ($a_id, $a_field)
 Lookup.

Detailed Description

Media Pool Item.

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.ilMediaPoolItem.php.

Constructor & Destructor Documentation

ilMediaPoolItem::__construct (   $a_id = 0)

Construtor.

Parameters
intmedia pool item id

Definition at line 18 of file class.ilMediaPoolItem.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

ilMediaPoolItem::create ( )

Create.

Definition at line 110 of file class.ilMediaPoolItem.php.

References $ilDB, getForeignId(), getTitle(), getType(), and setId().

{
global $ilDB;
$nid = $ilDB->nextId("mep_item");
$ilDB->manipulate("INSERT INTO mep_item ".
"(obj_id, type, foreign_id, title) VALUES (".
$ilDB->quote($nid, "integer").",".
$ilDB->quote($this->getType(), "text").",".
$ilDB->quote($this->getForeignId(), "integer").",".
$ilDB->quote($this->getTitle(), "text").
")");
$this->setId($nid);
}

+ Here is the call graph for this function:

ilMediaPoolItem::delete ( )

Delete.

Parameters
@return

Definition at line 167 of file class.ilMediaPoolItem.php.

References $ilDB.

{
global $ilDB;
$ilDB->manipulate("DELETE FROM mep_item WHERE "
." obj_id = ".$ilDB->quote($this->getId(), "integer")
);
}
ilMediaPoolItem::getForeignId ( )

Get foreign id.

Returns
int foreign id

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

Referenced by create().

{
return $this->foreign_id;
}

+ Here is the caller graph for this function:

ilMediaPoolItem::getId ( )

Get id.

Returns
int id

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

{
return $this->id;
}
static ilMediaPoolItem::getPoolForItemId (   $a_id)
static

Get media pools for item id.

Definition at line 249 of file class.ilMediaPoolItem.php.

References $ilDB.

Referenced by ilPageEditorGUI\showSnippetInfo().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM mep_tree ".
" WHERE child = ".$ilDB->quote($a_id, "integer")
);
$pool_ids = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$pool_ids[] = $rec["mep_id"];
}
return $pool_ids; // currently this array should contain only one id
}

+ Here is the caller graph for this function:

ilMediaPoolItem::getTitle ( )

Get title.

Returns
string title

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

References $title.

Referenced by create().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilMediaPoolItem::getType ( )

Get type.

Returns
string type

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

References $type.

Referenced by create().

{
return $this->type;
}

+ Here is the caller graph for this function:

static ilMediaPoolItem::lookup (   $a_id,
  $a_field 
)
staticprivate

Lookup.

Parameters
@return

Definition at line 182 of file class.ilMediaPoolItem.php.

References $ilDB.

Referenced by lookupForeignId(), lookupTitle(), and lookupType().

{
global $ilDB;
$set = $ilDB->query("SELECT ".$a_field." FROM mep_item WHERE ".
" obj_id = ".$ilDB->quote($a_id, "integer"));
if ($rec = $ilDB->fetchAssoc($set))
{
return $rec[$a_field];
}
return false;
}

+ Here is the caller graph for this function:

static ilMediaPoolItem::lookupForeignId (   $a_id)
static

Lookup Foreign Id.

Parameters
intmep item id

Definition at line 200 of file class.ilMediaPoolItem.php.

References lookup().

Referenced by ilObjMediaPoolGUI\copyToClipboard(), ilPCMediaObjectGUI\create(), ilObjMediaPool\delete(), ilObjMediaPool\deleteChild(), ilObjMediaPoolGUI\executeCommand(), ilPCMediaObjectGUI\selectObjectReference(), and ilInternalLinkGUI\showLinkHelp().

{
return self::lookup($a_id, "foreign_id");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilMediaPoolItem::lookupTitle (   $a_id)
static

Lookup title.

Parameters
intmep item id

Definition at line 220 of file class.ilMediaPoolItem.php.

References lookup().

Referenced by ilObjMediaPoolGUI\confirmRemove(), ilObjMediaPool\deleteChild(), ilObjMediaPoolGUI\getFolderValues(), ilObjMediaPoolSubItemListGUI\getHTML(), ilObjMediaPoolGUI\getMediaPoolPageValues(), ilObjMediaPoolGUI\insertFromClipboard(), and ilMediaPoolPageGUI\showPage().

{
return self::lookup($a_id, "title");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilMediaPoolItem::lookupType (   $a_id)
static

Lookup type.

Parameters
intmep item id

Definition at line 210 of file class.ilMediaPoolItem.php.

References lookup().

Referenced by ilObjMediaPoolGUI\confirmRemove(), ilObjMediaPoolGUI\copyToClipboard(), and ilObjMediaPool\deleteChild().

{
return self::lookup($a_id, "type");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaPoolItem::read ( )

Read.

Definition at line 128 of file class.ilMediaPoolItem.php.

References $ilDB, setForeignId(), setTitle(), and setType().

Referenced by __construct().

{
global $ilDB;
$set = $ilDB->query("SELECT * FROM mep_item WHERE ".
"obj_id = ".$ilDB->quote($this->getId(), "integer")
);
if ($rec = $ilDB->fetchAssoc($set))
{
$this->setType($rec["type"]);
$this->setForeignId($rec["foreign_id"]);
$this->setTitle($rec["title"]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaPoolItem::setForeignId (   $a_val)

Set foreign id.

Parameters
intforeign id

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

Referenced by read().

{
$this->foreign_id = $a_val;
}

+ Here is the caller graph for this function:

ilMediaPoolItem::setId (   $a_val)

Set id.

Parameters
intid

Definition at line 32 of file class.ilMediaPoolItem.php.

Referenced by __construct(), and create().

{
$this->id = $a_val;
}

+ Here is the caller graph for this function:

ilMediaPoolItem::setTitle (   $a_val)

Set title.

Parameters
stringtitle

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

Referenced by read().

{
$this->title = $a_val;
}

+ Here is the caller graph for this function:

ilMediaPoolItem::setType (   $a_val)

Set type.

Parameters
stringtype

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

Referenced by read().

{
$this->type = $a_val;
}

+ Here is the caller graph for this function:

ilMediaPoolItem::update ( )

Update.

Parameters
@return

Definition at line 149 of file class.ilMediaPoolItem.php.

References $ilDB.

{
global $ilDB;
$ilDB->manipulate("UPDATE mep_item SET ".
" type = ".$ilDB->quote($this->getType(), "text").",".
" foreign_id = ".$ilDB->quote($this->getForeignId(), "integer").",".
" title = ".$ilDB->quote($this->getTitle(), "text").
" WHERE obj_id = ".$ilDB->quote($this->getId(), "integer")
);
}
static ilMediaPoolItem::updateObjectTitle (   $a_obj)
static

Update object title.

Parameters
@return

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

References $ilDB, $title, ilObject\_lookupTitle(), and ilObject\_lookupType().

Referenced by ilMediaPoolAppEventListener\handleEvent().

{
global $ilDB;
if (ilObject::_lookupType($a_obj) == "mob")
{
$ilDB->manipulate("UPDATE mep_item SET ".
" title = ".$ilDB->quote($title, "text").
" WHERE foreign_id = ".$ilDB->quote($a_obj, "integer").
" AND type = ".$ilDB->quote("mob", "text")
);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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