5require_once 
"./Services/Object/classes/class.ilObject.php";
 
   21    public static $purposes = array(
"Standard", 
"VideoAlternative", 
"VideoPortable", 
"AudioPortable");
 
   52    public function __construct($a_id = 0, $a_call_by_reference = 
true)
 
   56        $this->db = 
$DIC->database();
 
   57        $this->
user = $DIC->user();
 
   62        $this->
setOrder(self::ORDER_CREATION_DATE_DESC);
 
   72        $this->online = $a_online;
 
   92        $this->publicfiles = $a_publicfiles;
 
  112        $this->view_mode = $a_val;
 
  131        $this->itemsarray = $a_itemsarray;
 
  141        return $this->itemsarray;
 
  165                $med_items = 
ilUtil::sortArray($med_items, 
"creation_date", 
"desc", 
false, 
true);
 
  171                foreach (array_keys($med_items) as $idx) {
 
  172                    if (array_key_exists($idx, 
$order)) {
 
  173                        $med_items[$idx][
"order"] = (
$order[$idx] + 1) * 10;
 
  177                        $med_items[$idx][
"order"] = (++$pos) * 10;
 
  196        $this->downloadable = $a_downloadable;
 
  225        $this->defaultAccess = (int) $value == 0 ? 0 : 1;
 
  235        $this->order = $a_value;
 
  255        require_once(
"./Modules/MediaCast/classes/class.ilObjMediaCastAccess.php");
 
  268        $query = 
"INSERT INTO il_media_cast_data (" .
 
  298        if (!parent::update()) {
 
  303        $query = 
"UPDATE il_media_cast_data SET " .
 
  304            " is_online = " . 
$ilDB->quote((
int) $this->
getOnline(), 
"integer") .
 
  308            ", sortmode = " . 
$ilDB->quote((
int) $this->
getOrder(), 
"integer") .
 
  310            " WHERE id = " . 
$ilDB->quote((
int) $this->
getId(), 
"integer");
 
  327        $query = 
"SELECT * FROM il_media_cast_data WHERE id = " .
 
  330        $rec = 
$ilDB->fetchAssoc($set);
 
  347    public function delete()
 
  352        if (!parent::delete()) {
 
  358        foreach ($med_items as $item) {
 
  359            include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
  361            $news_item->delete();
 
  367        $query = 
"DELETE FROM il_media_cast_data" .
 
  368            " WHERE id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  380        include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
  382        $it->setContextObjId($this->
getId());
 
  383        $it->setContextObjType($this->
getType());
 
  384        $this->itemsarray = $it->queryNewsForContext(
false, 0, 
"", 
false, $a_oldest_first);
 
  386        return $this->itemsarray;
 
  393        if (!$this->
getId()) {
 
  397        $sql = 
"DELETE FROM il_media_cast_data_ord" .
 
  398            " WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
"integer");
 
  399        $ilDB->manipulate($sql);
 
  406        if (!$this->
getId()) {
 
  411        $sql = 
"SELECT item_id FROM il_media_cast_data_ord" .
 
  412            " WHERE obj_id = " . 
$ilDB->quote($this->
getId(), 
"integer") .
 
  416            $all[] = $row[
"item_id"];
 
  425        if (!$this->
getId()) {
 
  432        foreach ($a_items as $item_id) {
 
  435            $sql = 
"INSERT INTO il_media_cast_data_ord (obj_id,item_id,pos)" .
 
  436                " VALUES (" . 
$ilDB->quote($this->
getId(), 
"integer") . 
"," .
 
  437                $ilDB->quote($item_id, 
"integer") . 
"," .
 
  438                $ilDB->quote($pos, 
"integer") . 
")";
 
  439            $ilDB->manipulate($sql);
 
  449    public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree = 
false)
 
  451        $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
 
  456        if (!$cp_options->isRootNode($this->getRefId())) {
 
  464        $new_obj->setOrder($this->
getOrder());
 
  468        include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
 
  480        include_once(
'./Services/Tracking/classes/class.ilLPObjSettings.php');
 
  482        $obj_settings->cloneSettings($new_obj->getId());
 
  483        unset($obj_settings);
 
  488        $collection = $olp->getCollectionInstance();
 
  490            $collection->cloneCollection($new_obj->getRefId(), $cp_options->getCopyId(), $this->mob_mapping);
 
  506        include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
  507        foreach ($this->
readItems(
true) as $item) {
 
  509            $mob_id = $item[
"mob_id"];
 
  511            $new_mob = $mob->duplicate();
 
  515            include_once(
"./Services/News/classes/class.ilNewsItem.php");
 
  517            $mc_item->setMobId($new_mob->getId());
 
  519            $mc_item->setContextObjId($a_new_obj->getId());
 
  520            $mc_item->setContextObjType($a_new_obj->getType());
 
  521            $mc_item->setUserId(
$ilUser->getId());
 
  522            $mc_item->setPlaytime($item[
"playtime"]);
 
  523            $mc_item->setTitle($item[
"title"]);
 
  524            $mc_item->setContent($item[
"content"]);
 
  525            $mc_item->setVisibility($item[
"visibility"]);
 
  527            $this->mob_mapping[$mob_id] = $new_mob->getId();
 
  534        require_once 
'Services/Tracking/classes/class.ilChangeEvent.php';
 
  543        require_once 
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
 
An exception for terminatinating execution or to throw for unit testing.
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static getInstance($a_obj_id)
Class ilObject Basic functions for all objects.
getType()
get object type @access public
getRefId()
get reference id @access public
getId()
get object id @access public
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res