ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSoapStructureObject.php
Go to the documentation of this file.
1<?php
23{
24 public int $obj_id;
25 public string $title;
26 public string $type;
27 public string $description;
28 public ?int $parentRefId;
29
30 public array $structureObjects = array();
31
32 public function __construct(int $objId, string $type, string $title, string $description, ?int $parentRefId = null)
33 {
34 $this->setObjId($objId);
35 $this->setType($type);
36 $this->setTitle($title);
37 $this->setDescription($description);
38 $this->parentRefId = $parentRefId;
39 }
40
41 public function addStructureObject(ilSoapStructureObject $structureObject): void
42 {
43 $this->structureObjects [$structureObject->getObjId()] = $structureObject;
44 }
45
46 public function getStructureObjects(): array
47 {
49 }
50
51 public function setObjId(int $value): void
52 {
53 $this->obj_id = $value;
54 }
55
56 public function getObjId(): int
57 {
58 return $this->obj_id;
59 }
60
61 public function setTitle(string $value): void
62 {
63 $this->title = $value;
64 }
65
66 public function getTitle(): string
67 {
68 return $this->title;
69 }
70
71 public function setDescription(string $value): void
72 {
73 $this->description = $value;
74 }
75
76 public function getDescription(): string
77 {
78 return $this->description;
79 }
80
81 public function setType(string $value): void
82 {
83 $this->type = $value;
84 }
85
86 public function getType(): string
87 {
88 return $this->type;
89 }
90
91 public function getGotoLink(): string
92 {
93 return ILIAS_HTTP_PATH . "/" . "goto.php?target=" . $this->getType() .
94 "_" . $this->getObjId() .
95 (is_numeric($this->getParentRefId()) ? "_" . $this->getParentRefId() : "") . "&client_id=" . CLIENT_ID;
96 }
97
98 public function getInternalLink(): string
99 {
100 return '';
101 }
102
106 public function _getXMLAttributes(): array
107 {
108 return array(
109 'type' => $this->getType(),
110 'obj_id' => $this->getObjId()
111 );
112 }
113
114 public function _getTagName(): string
115 {
116 return "StructureObject";
117 }
118
119 public function setParentRefId(int $parentRefId): void
120 {
121 $this->parentRefId = $parentRefId;
122 }
123
124 public function getParentRefId(): ?int
125 {
126 return $this->parentRefId;
127 }
128
129 public function exportXML(ilXmlWriter $xml_writer): void
130 {
131 $attrs = $this->_getXMLAttributes();
132
133 $xml_writer->xmlStartTag($this->_getTagName(), $attrs);
134
135 $xml_writer->xmlElement('Title', null, $this->getTitle());
136 $xml_writer->xmlElement('Description', null, $this->getDescription());
137 $xml_writer->xmlElement('InternalLink', null, $this->getInternalLink());
138 $xml_writer->xmlElement('GotoLink', null, $this->getGotoLink());
139
140 $xml_writer->xmlStartTag("StructureObjects");
141
143
144 foreach ($structureObjects as $structureObject) {
145 $structureObject->exportXML($xml_writer);
146 }
147
148 $xml_writer->xmlEndTag("StructureObjects");
149
150 $xml_writer->xmlEndTag($this->_getTagName());
151 }
152}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $objId, string $type, string $title, string $description, ?int $parentRefId=null)
exportXML(ilXmlWriter $xml_writer)
addStructureObject(ilSoapStructureObject $structureObject)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
const CLIENT_ID
Definition: constants.php:41
$objId
Definition: xapitoken.php:57