24 include_once
'./Services/Object/classes/class.ilObject.php';
50 public function __construct($a_id = 0,$a_call_by_reference =
true)
54 parent::__construct($a_id,$a_call_by_reference);
69 $query =
"SELECT * FROM container_reference ".
70 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ";
74 return $row->target_obj_id;
89 $query =
"SELECT ref_id FROM object_reference obr ".
90 "JOIN container_reference cr ON obr.obj_id = cr.target_obj_id ".
91 "WHERE cr.obj_id = ".$ilDB->quote($a_obj_id,
'integer');
109 $query =
'SELECT title,title_type FROM container_reference cr '.
110 'JOIN object_data od ON cr.obj_id = od.obj_id '.
111 'WHERE cr.obj_id = '.$ilDB->quote($a_obj_id,
'integer');
133 $query =
"SELECT title FROM object_data od ".
134 "JOIN container_reference cr ON target_obj_id = od.obj_id ".
135 "WHERE cr.obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
155 $query =
"SELECT * FROM container_reference ".
156 "WHERE target_obj_id = ".$ilDB->quote($a_target_id,
'integer').
" ";
177 $query =
"SELECT * FROM container_reference ".
178 "WHERE target_obj_id = ".$ilDB->quote($a_target_id,
'integer').
" ";
209 $this->target_id = $a_target_id;
221 $this->target_ref_id = $a_id;
251 $this->title_type =
$type;
266 $query =
"SELECT * FROM container_reference ".
267 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
280 #$this->title = $this->lng->txt('reference_of').' '.ilObject::_lookupTitle($this->getTargetId()); 297 return $this->lng->txt(
'reference_of').
' '.$this->
getTitle();
314 $query =
"DELETE FROM container_reference ".
315 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
316 $ilDB->manipulate(
$query);
318 $query =
"INSERT INTO container_reference (obj_id, target_obj_id, title_type) ".
320 $ilDB->quote($this->
getId(),
'integer').
", ".
324 $ilDB->manipulate(
$query);
334 public function delete()
338 if(!parent::delete())
343 $query =
"DELETE FROM container_reference ".
344 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
345 $ilDB->manipulate(
$query);
358 public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree =
false)
362 $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
364 $query =
"INSERT INTO container_reference (obj_id, target_obj_id, title_type) ".
366 $ilDB->quote($new_obj->getId(),
'integer').
", ".
367 $ilDB->quote($this->getTargetId(),
'integer').
", ".
368 $ilDB->quote($this->getTitleType(),
'integer').
' '.
370 $ilDB->manipulate(
$query);
getTitleType()
get title type
getTargetId()
get target id
Class ilObject Basic functions for all objects.
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.
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.
Create styles array
The data for the language used.
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.