ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjStudyProgrammeReference.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
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}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26