Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00034 require_once "./classes/class.ilObject.php";
00035
00036 class ilObjiLincCourse extends ilObject
00037 {
00044 function ilObjiLincCourse($a_id = 0,$a_call_by_reference = true)
00045 {
00046 $this->type = "icrs";
00047 $this->ilObject($a_id,$a_call_by_reference);
00048 }
00049
00054 function read()
00055 {
00056 parent::read();
00057
00058
00059 $q = "SELECT * FROM ilinc_data ".
00060 "WHERE obj_id='".$this->id."'";
00061 $r = $this->ilias->db->query($q);
00062
00063 if ($r->numRows() > 0)
00064 {
00065 $data = $r->fetchRow(DB_FETCHMODE_OBJECT);
00066
00067
00068 $this->ilinc_id = $data->course_id;
00069 }
00070 else
00071 {
00072 $this->ilias->raiseError("<b>Error: There is no dataset with id ".$this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__."<br />Line: ".__LINE__, $this->ilias->FATAL);
00073 }
00074 }
00075
00082 function update()
00083 {
00084 if (!parent::update())
00085 {
00086 return false;
00087 }
00088
00089
00090
00091 return true;
00092 }
00093
00101 function ilClone($a_parent_ref)
00102 {
00103 global $rbacadmin;
00104
00105
00106 $new_ref_id = parent::ilClone($a_parent_ref);
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 return $new_ref_id;
00122 }
00123
00130 function delete()
00131 {
00132
00133 if (!parent::delete())
00134 {
00135 return false;
00136 }
00137
00138
00139 $q = "DELETE FROM ilinc_data WHERE course_id='".$this->ilinc_id."'";
00140 $this->ilias->db->query($q);
00141
00142 include_once "class.ilnetucateXMLAPI.php";
00143 $ilinc = new ilnetucateXMLAPI();
00144 $ilinc->removeCourse($this->ilinc_id);
00145 $response = $ilinc->sendRequest();
00146
00147 return true;
00148 }
00149
00150 function saveID($a_icrs_id)
00151 {
00152 $q = "INSERT INTO ilinc_data (obj_id,type,course_id,class_id) VALUES (".$this->id.",'icrs','".$a_icrs_id."',null)";
00153 $this->ilias->db->query($q);
00154 }
00155
00165 function initDefaultRoles()
00166 {
00167 global $rbacadmin;
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179 return $roles ? $roles : array();
00180 }
00181
00195 function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
00196 {
00197 return true;
00198 }
00199 }
00200 ?>