ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Builder.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
26 class Builder implements BuilderInterface
27 {
28  protected string $source;
29 
33  protected array $values;
34  protected ?Condition $condition = null;
35 
36  public function __construct(
37  string $source,
38  string ...$values
39  ) {
40  $this->source = $source;
41  $this->values = $values;
42  }
43 
44  public function withCondition(
45  string $value,
47  ): BuilderInterface {
48  $clone = clone $this;
49  $clone->condition = new Condition($value, $path);
50  return $clone;
51  }
52 
53  public function get(): VocabularyInterface
54  {
55  return new Vocabulary(
56  $this->source,
57  $this->condition,
58  ...$this->values
59  );
60  }
61 }
$path
Definition: ltiservices.php:32
withCondition(string $value, PathInterface $path)
Definition: Builder.php:44
__construct(string $source, string ... $values)
Definition: Builder.php:36