19 declare(strict_types=1);
73 bool $add_as_first =
false 91 bool $add_as_first =
false 94 foreach ($next_step->
filters() as $filter) {
95 $builder = $builder->withAdditionalFilterAtCurrentStep(
110 if (!isset($this->current_step_name)) {
111 throw new \ilMDPathException(
112 'Cannot add filter because there is no current step.' 115 $clone = clone $this;
116 $clone->current_step_filters[] =
new Filter(
131 $clone->leads_to_one,
135 if (!
$path->isRelative()) {
146 $element = $this->structure->getRoot();
147 foreach ($path->
steps() as $step) {
148 $name = $step->name();
150 $element = $element->getSuperElement();
152 $element = $element->getSubElement($name);
154 if (is_null($element)) {
155 $name = is_string($name) ? $name : $name->value;
156 throw new \ilMDPathException(
157 "In the path '" . $path->
toString() .
"', the step '" . $name .
"' is invalid." 165 bool $add_as_first =
false 168 $clone->current_step_name = $name;
169 $clone->current_add_as_first = $add_as_first;
175 $clone = clone $this;
176 if (!isset($clone->current_step_name)) {
180 $new_step =
new Step(
181 $clone->current_step_name,
182 ...$clone->current_step_filters
184 if ($clone->current_add_as_first) {
185 array_unshift($clone->steps, $new_step);
187 $clone->steps[] = $new_step;
190 $clone->current_step_name =
null;
191 $clone->current_step_filters = [];
192 $clone->current_add_as_first =
false;
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null