24 include_once
'./Services/Object/classes/class.ilObject.php';
55 public function __construct($a_id = 0, $a_call_by_reference =
true)
59 $this->db = $DIC->database();
60 $this->
user = $DIC->user();
61 $ilDB = $DIC->database();
63 parent::__construct($a_id, $a_call_by_reference);
78 $ilDB = $DIC->database();
80 $query =
"SELECT * FROM container_reference " .
81 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer') .
" ";
84 return $row->target_obj_id;
99 $ilDB = $DIC->database();
101 $query =
"SELECT ref_id FROM object_reference obr " .
102 "JOIN container_reference cr ON obr.obj_id = cr.target_obj_id " .
103 "WHERE cr.obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
120 $ilDB = $DIC->database();
122 $query =
'SELECT title,title_type FROM container_reference cr ' .
123 'JOIN object_data od ON cr.obj_id = od.obj_id ' .
124 'WHERE cr.obj_id = ' .
$ilDB->quote($a_obj_id,
'integer');
144 $ilDB = $DIC->database();
146 $query =
"SELECT title FROM object_data od " .
147 "JOIN container_reference cr ON target_obj_id = od.obj_id " .
148 "WHERE cr.obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
167 $ilDB = $DIC->database();
169 $query =
"SELECT * FROM container_reference " .
170 "WHERE target_obj_id = " .
$ilDB->quote($a_target_id,
'integer') .
" ";
190 $ilDB = $DIC->database();
192 $query =
"SELECT * FROM container_reference " .
193 "WHERE target_obj_id = " .
$ilDB->quote($a_target_id,
'integer') .
" ";
223 $this->target_id = $a_target_id;
235 $this->target_ref_id = $a_id;
265 $this->title_type =
$type;
280 $query =
"SELECT * FROM container_reference " .
281 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
292 #$this->title = $this->lng->txt('reference_of').' '.ilObject::_lookupTitle($this->getTargetId()); 306 return $this->lng->txt(
'reference_of') .
' ' . $this->
getTitle();
323 $query =
"DELETE FROM container_reference " .
324 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
327 $query =
"INSERT INTO container_reference (obj_id, target_obj_id, title_type) " .
329 $ilDB->quote($this->
getId(),
'integer') .
", " .
343 public function delete()
347 if (!parent::delete()) {
351 $query =
"DELETE FROM container_reference " .
352 "WHERE obj_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
366 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
371 $new_obj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
373 $query =
"INSERT INTO container_reference (obj_id, target_obj_id, title_type) " .
375 $ilDB->quote($new_obj->getId(),
'integer') .
", " .
376 $ilDB->quote($this->getTargetId(),
'integer') .
", " .
377 $ilDB->quote($this->getTitleType(),
'integer') .
' ' .
getTitleType()
get title type
getTargetId()
get target id
getPresentationTitle()
Get presentation title.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
setTitleType($type)
Set title type.
foreach($_POST as $key=> $value) $res
static _lookupTitle($a_obj_id)
Overwitten from base class.
getId()
get object id public
getTargetRefId()
get Target ref_id
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone course reference.
getTitle()
get object title public
static _lookupTargetTitle($a_obj_id)
Lookup target title.
update($pash, $contents, Config $config)
setTargetRefId($a_id)
set target ref_id
setTargetId($a_target_id)
set target id
static _lookupSourceId($a_target_id)
lookup source id
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static _lookupSourceIds($a_target_id)
Get ids of all container references that target the object with the given id.
static _lookupTargetId($a_obj_id)
lookup target id
__construct($a_id=0, $a_call_by_reference=true)
Constructor.