ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
Vocabulary.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
26 {
27  protected string $source;
28 
32  protected array $values;
34 
35  public function __construct(
36  string $source,
37  ?ConditionInterface $condition = null,
38  string ...$values
39  ) {
40  $this->source = $source;
41  $this->values = $values;
42  $this->condition = $condition;
43  }
44 
45  public function source(): string
46  {
47  return $this->source;
48  }
49 
53  public function values(): \Generator
54  {
55  foreach ($this->values as $value) {
56  yield $value;
57  }
58  }
59 
60  public function isConditional(): bool
61  {
62  return isset($this->condition);
63  }
64 
65  public function condition(): ?ConditionInterface
66  {
67  return $this->condition;
68  }
69 }
__construct(string $source, ?ConditionInterface $condition=null, string ... $values)
Definition: Vocabulary.php:35
isConditional()
Some vocabularies are only available if a different MD element has a certain value.
Definition: Vocabulary.php:60
condition()
Contains the path to the element this vocabulary is conditional on, and the value the element needs t...
Definition: Vocabulary.php:65