ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjStudyProgrammeReference.php
Go to the documentation of this file.
1<?php
2
4{
11 public function __construct($a_id = 0, $a_call_by_reference = true)
12 {
13 global $DIC;
14 $this->type = 'prgr';
15 $this->tree = $DIC['tree'];
16 parent::__construct($a_id, $a_call_by_reference);
17 }
18
24 public function putInTree($a_parent_ref)
25 {
26 $res = parent::putInTree($a_parent_ref);
27
28 if (ilObject::_lookupType($a_parent_ref, true) == "prg") {
29 $par = ilObjStudyProgramme::getInstanceByRefId($a_parent_ref);
30 $par->nodeInserted($this->getReferencedObject());
31 }
32
33 return $res;
34 }
35
36 public function getParent() : ?\ilObjStudyProgramme
37 {
38 $parent_data = $this->tree->getParentNodeData($this->getRefId());
39 if ($parent_data["type"] === "prg" && !$parent_data["deleted"]) {
40 return ilObjStudyProgramme::getInstanceByRefId($parent_data["ref_id"]);
41 }
42 return null;
43 }
44
45 public function getReferencedObject()
46 {
47 if (!$this->referenced_object) {
48 $this->referenced_object = ilObjStudyProgramme::getInstanceByRefId($this->target_ref_id);
49 }
51 }
52}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
putInTree($a_parent_ref)
Overwritten from ilObject.
static getInstanceByRefId($a_ref_id)
getRefId()
get reference id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res
$DIC
Definition: xapitoken.php:46