ILIAS  release_8 Revision v8.24
class.ilObjStudyProgrammeReference.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22{
24
25 public function __construct(int $id = 0, bool $call_by_reference = true)
26 {
27 global $DIC;
28 $this->type = 'prgr';
29 $this->tree = $DIC['tree'];
31 }
32
38 public function putInTree(int $a_parent_ref): void
39 {
40 parent::putInTree($a_parent_ref);
41
42 if (ilObject::_lookupType($a_parent_ref, true) == "prg") {
43 $par = ilObjStudyProgramme::getInstanceByRefId($a_parent_ref);
44 $par->nodeInserted($this);
45 }
46 }
47
48 public function getParent(): ?ilObjStudyProgramme
49 {
50 $parent_data = $this->tree->getParentNodeData($this->getRefId());
51 if ($parent_data["type"] === "prg" && !$parent_data["deleted"]) {
52 return ilObjStudyProgramme::getInstanceByRefId($parent_data["ref_id"]);
53 }
54 return null;
55 }
56
58 {
59 if (is_null($this->referenced_object)) {
60 $this->read();
61 $this->referenced_object = ilObjStudyProgramme::getInstanceByRefId($this->target_ref_id);
62 }
64 }
65}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
putInTree(int $a_parent_ref)
Overwritten from ilObject.
__construct(int $id=0, bool $call_by_reference=true)
static _lookupType(int $id, bool $reference=false)
bool $call_by_reference
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc