24 include_once
'Services/Object/classes/class.ilObject.php';
51 public function __construct($a_id = 0,$a_call_by_reference =
true)
55 parent::__construct($a_id,$a_call_by_reference);
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);
340 $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
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);
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
const DB_FETCHMODE_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
getTitle()
get object title public
static _lookupTargetTitle($a_obj_id)
Lookup target title.
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 _lookupTargetId($a_obj_id)
lookup target id
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
cloneObject($a_target_id, $a_copy_id=0)
Clone course reference.