105 : Dictionary
106 {
107 $tag_assignments = [
117 ];
118
119 $path_factory = new class () extends NullFactory {
120 public function toElement(
121 BaseElementInterface $to,
122 bool $leads_to_exactly_one = false
123 ): PathInterface {
124 return new class ($to->getMDID()) extends NullPath {
126 {
127 }
128
130 {
132 }
133 };
134 }
135 };
136
137 $navigator_factory = new class () extends NullNavigatorFactory {
138 public function navigator(
140 ElementInterface $start_element
141 ): NavigatorInterface {
142 return new class (
$path, $start_element) extends NullNavigator {
143 protected ElementInterface $start_element;
144
146 protected PathInterface
$path,
147 ElementInterface $start_element
148 ) {
149 if ($start_element->getMDID() === 0) {
150 $this->start_element = $start_element;
151 } else {
152 $this->start_element = $start_element->getSuperElement();
153 }
154 }
155
156 public function elementsAtFinalStep(): \Generator
157 {
158 if ($this->path->toString() === '0') {
159 yield $this->start_element;
160 return;
161 }
162
163 foreach ($this->start_element->getSubElements() as $sub) {
164 if ((string) $sub->getMDID() === $this->path->toString()) {
165 yield $sub;
166 }
167 }
168 }
169 };
170 }
171 };
172
173 return new class ($path_factory, $navigator_factory, ...$tag_assignments) extends Dictionary {
175 PathFactoryInterface $path_factory,
176 NavigatorFactoryInterface $navigator_factory,
177 TagAssignmentInterface ...$tag_assignments
178 ) {
180 }
181 };
182 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct()
Constructor setup ILIAS global object @access public.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc