19 declare(strict_types=1);
44 public function withNextStep(
string $name,
bool $add_as_first =
false):
BuilderInterface 46 return new self($this->path .
':' . $name);
49 public function withNextStepToSuperElement(
bool $add_as_first =
false):
BuilderInterface 51 return new self($this->path .
':^');
54 public function withAdditionalFilterAtCurrentStep(
58 if ($this->path ===
'') {
59 throw new \ilMDPathException(
'failed');
62 $filter =
'{' . $type->value .
';' . implode(
',', $values) .
'}';
63 return new self($this->path . $filter);
68 if (str_contains($this->path,
':INVALID')) {
69 throw new \ilMDPathException(
'failed');
73 public function __construct(
public string $path_string)
80 return new class ($internal_builder) extends
Builder {
86 public function exposePath():
string 88 return $this->internal_builder->path;
96 $builder1 = $builder->withNextStep(
'step');
100 $builder->exposePath()
104 $builder1->exposePath()
111 $builder1 = $builder->withNextStepToSuperElement();
115 $builder->exposePath()
119 $builder1->exposePath()
126 $builder1 = $builder->withNextStep(
'step')
131 $builder->exposePath()
135 $builder1->exposePath()
143 $this->expectException(\ilMDServicesException::class);
150 ->withNextStep(
'step1')
151 ->withNextStepToSuperElement()
152 ->withNextStep(
'step2')
153 ->withAdditionalFilterAtCurrentStep(FilterType::MDID,
'12');
155 ->withNextStep(
'step3')
156 ->withNextStepToSuperElement();
159 ':step1:^:step2{id;12}',
160 $builder->get()->path_string
163 ':step1:^:step2{id;12}:step3:^',
164 $builder3->get()->path_string
170 $builder = $this->
getBuilder()->withNextStep(
'INVALID');
172 $this->expectException(\ilMDServicesException::class);
__construct(Container $dic, ilPlugin $plugin)