24 include_once
'Services/Object/classes/class.ilObject.php';
51 public function __construct($a_id = 0,$a_call_by_reference =
true)
70 $query =
"SELECT * FROM container_reference ".
71 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ";
75 return $row->target_obj_id;
90 $query =
"SELECT ref_id FROM object_reference obr ".
91 "JOIN container_reference cr ON obr.obj_id = cr.target_obj_id ".
92 "WHERE cr.obj_id = ".$ilDB->quote($a_obj_id,
'integer');
110 $query =
'SELECT title,title_type FROM container_reference cr '.
111 'JOIN object_data od ON cr.obj_id = od.obj_id '.
112 'WHERE cr.obj_id = '.$ilDB->quote($a_obj_id,
'integer');
134 $query =
"SELECT title FROM object_data od ".
135 "JOIN container_reference cr ON target_obj_id = od.obj_id ".
136 "WHERE cr.obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
156 $query =
"SELECT * FROM container_reference ".
157 "WHERE target_obj_id = ".$ilDB->quote($a_target_id,
'integer').
" ";
187 $this->target_id = $a_target_id;
199 $this->target_ref_id = $a_id;
229 $this->title_type =
$type;
244 $query =
"SELECT * FROM container_reference ".
245 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
258 #$this->title = $this->lng->txt('reference_of').' '.ilObject::_lookupTitle($this->getTargetId());
275 return $this->lng->txt(
'reference_of').
' '.$this->
getTitle();
292 $query =
"DELETE FROM container_reference ".
293 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
294 $ilDB->manipulate(
$query);
296 $query =
"INSERT INTO container_reference (obj_id, target_obj_id, title_type) ".
298 $ilDB->quote($this->
getId(),
'integer').
", ".
302 $ilDB->manipulate(
$query);
312 public function delete()
316 if(!parent::delete())
321 $query =
"DELETE FROM container_reference ".
322 "WHERE obj_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
323 $ilDB->manipulate(
$query);
342 $query =
"INSERT INTO container_reference (obj_id, target_obj_id, title_type) ".
344 $ilDB->quote($new_obj->getId(),
'integer').
", ".
345 $ilDB->quote($this->getTargetId(),
'integer').
", ".
346 $ilDB->quote($this->getTitleType(),
'integer').
' '.
348 $ilDB->manipulate(
$query);