Class ilObjMediaCast. More...
Inheritance diagram for ilObjMediaCast:
Collaboration diagram for ilObjMediaCast:Public Member Functions | |
| ilObjMediaCast ($a_id=0, $a_call_by_reference=true) | |
| Constructor public. | |
| setOnline ($a_online) | |
| Set Online. | |
| getOnline () | |
| Get Online. | |
| setPublicFiles ($a_publicfiles) | |
| Set PublicFiles. | |
| getPublicFiles () | |
| Get PublicFiles. | |
| setItemsArray ($a_itemsarray) | |
| Set ItemsArray. | |
| getItemsArray () | |
| Get ItemsArray. | |
| create () | |
| Create mew media cast. | |
| update () | |
| update object data | |
| read () | |
| Read media cast. | |
| delete () | |
| delete object and all related data | |
| initDefaultRoles () | |
| init default roles settings | |
| notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0) | |
| notifys an object about an event occured Based on the event happend, each object may decide how it reacts. | |
| readItems () | |
| Get all items of media cast. | |
Protected Attributes | |
| $online = false | |
| $publicfiles = false | |
Class ilObjMediaCast.
Definition at line 33 of file class.ilObjMediaCast.php.
| ilObjMediaCast::create | ( | ) |
Create mew media cast.
Reimplemented from ilObject.
Definition at line 113 of file class.ilObjMediaCast.php.
References ilObject::getId(), getOnline(), and getPublicFiles().
{
global $ilDB;
parent::create();
$query = "INSERT INTO il_media_cast_data (".
" id".
", online".
", public_files".
" ) VALUES (".
$ilDB->quote($this->getId())
.",".$ilDB->quote($this->getOnline())
.",".$ilDB->quote($this->getPublicFiles())
.")";
$ilDB->query($query);
}
Here is the call graph for this function:| ilObjMediaCast::delete | ( | ) |
delete object and all related data
public
Reimplemented from ilObject.
Definition at line 184 of file class.ilObjMediaCast.php.
References ilObject::getId(), and getItemsArray().
{
global $ilDB;
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
// delete all items
$med_items = $this->getItemsArray();
foreach ($med_items as $item)
{
include_once("./Services/News/classes/class.ilNewsItem.php");
$news_item = new ilNewsItem($item["id"]);
$news_item->delete();
}
// delete record of table il_media_cast_data
$query = "DELETE FROM il_media_cast_data".
" WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($query);
return true;
}
Here is the call graph for this function:| ilObjMediaCast::getItemsArray | ( | ) |
Get ItemsArray.
Definition at line 105 of file class.ilObjMediaCast.php.
Referenced by delete().
{
return $this->itemsarray;
}
Here is the caller graph for this function:| ilObjMediaCast::getOnline | ( | ) |
Get Online.
Definition at line 65 of file class.ilObjMediaCast.php.
Referenced by create(), and update().
{
return $this->online;
}
Here is the caller graph for this function:| ilObjMediaCast::getPublicFiles | ( | ) |
Get PublicFiles.
Definition at line 85 of file class.ilObjMediaCast.php.
Referenced by create(), and update().
{
return $this->publicfiles;
}
Here is the caller graph for this function:| ilObjMediaCast::ilObjMediaCast | ( | $ | a_id = 0, |
|
| $ | a_call_by_reference = true | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 44 of file class.ilObjMediaCast.php.
References ilObject::ilObject().
{
$this->type = "mcst";
$this->ilObject($a_id,$a_call_by_reference);
}
Here is the call graph for this function:| ilObjMediaCast::initDefaultRoles | ( | ) |
init default roles settings
If your module does not require any default roles, delete this method (For an example how this method is used, look at ilObjForum)
public
Reimplemented from ilObject.
Definition at line 220 of file class.ilObjMediaCast.php.
{
global $rbacadmin;
// create a local role folder
//$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
// create moderator role and assign role to rolefolder...
//$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
//$roles[] = $roleObj->getId();
//unset($rfoldObj);
//unset($roleObj);
return $roles ? $roles : array();
}
| ilObjMediaCast::notify | ( | $ | a_event, | |
| $ | a_ref_id, | |||
| $ | a_parent_non_rbac_id, | |||
| $ | a_node_id, | |||
| $ | a_params = 0 | |||
| ) |
notifys an object about an event occured Based on the event happend, each object may decide how it reacts.
If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)
public
| string | event | |
| integer | reference id of object where the event occured | |
| array | passes optional parameters if required |
Reimplemented from ilObject.
Definition at line 250 of file class.ilObjMediaCast.php.
References $_GET, and ilObject::getType().
{
global $tree;
switch ($a_event)
{
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
//exit;
break;
case "cut":
//echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
//exit;
break;
case "copy":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
//exit;
break;
case "paste":
//echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
//exit;
break;
case "new":
//echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
//exit;
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id==$_GET["ref_id"])
{
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if($parent_type == $this->getType())
{
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
}
Here is the call graph for this function:| ilObjMediaCast::read | ( | ) |
Read media cast.
Definition at line 160 of file class.ilObjMediaCast.php.
References ilObject::getId(), readItems(), setOnline(), and setPublicFiles().
{
global $ilDB;
parent::read();
$this->readItems();
$query = "SELECT * FROM il_media_cast_data WHERE id = ".
$ilDB->quote($this->getId());
$set = $ilDB->query($query);
$rec = $set->fetchRow(DB_FETCHMODE_ASSOC);
$this->setOnline($rec["online"]);
$this->setPublicFiles($rec["public_files"]);
}
Here is the call graph for this function:| ilObjMediaCast::readItems | ( | ) |
Get all items of media cast.
Definition at line 306 of file class.ilObjMediaCast.php.
References ilObject::getId(), and ilObject::getType().
Referenced by read().
{
global $ilDB;
//
include_once("./Services/News/classes/class.ilNewsItem.php");
$it = new ilNewsItem();
$it->setContextObjId($this->getId());
$it->setContextObjType($this->getType());
$this->itemsarray = $it->queryNewsForContext(false);
return $this->itemsarray;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilObjMediaCast::setItemsArray | ( | $ | a_itemsarray | ) |
Set ItemsArray.
| array | $a_itemsarray ItemsArray |
Definition at line 95 of file class.ilObjMediaCast.php.
{
$this->itemsarray = $a_itemsarray;
}
| ilObjMediaCast::setOnline | ( | $ | a_online | ) |
Set Online.
| boolean | $a_online Online |
Definition at line 55 of file class.ilObjMediaCast.php.
Referenced by read().
{
$this->online = $a_online;
}
Here is the caller graph for this function:| ilObjMediaCast::setPublicFiles | ( | $ | a_publicfiles | ) |
Set PublicFiles.
| boolean | $a_publicfiles PublicFiles |
Definition at line 75 of file class.ilObjMediaCast.php.
Referenced by read().
{
$this->publicfiles = $a_publicfiles;
}
Here is the caller graph for this function:| ilObjMediaCast::update | ( | ) |
update object data
public
Reimplemented from ilObject.
Definition at line 138 of file class.ilObjMediaCast.php.
References ilObject::getId(), getOnline(), and getPublicFiles().
{
global $ilDB;
if (!parent::update())
{
return false;
}
// update media cast data
$query = "UPDATE il_media_cast_data SET ".
" online = ".$ilDB->quote($this->getOnline()).
", public_files = ".$ilDB->quote($this->getPublicFiles()).
" WHERE id = ".$ilDB->quote($this->getId());
$ilDB->query($query);
return true;
}
Here is the call graph for this function:ilObjMediaCast::$online = false [protected] |
Definition at line 35 of file class.ilObjMediaCast.php.
ilObjMediaCast::$publicfiles = false [protected] |
Definition at line 36 of file class.ilObjMediaCast.php.
1.7.1