ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DictionaryInitiator.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\MetaData\Paths\FactoryInterface as PathFactoryInterface;
30
31abstract class DictionaryInitiator
32{
33 protected PathFactoryInterface $path_factory;
34
40
42
46 private array $tag_assignments = [];
47
48 public function __construct(
49 PathFactoryInterface $path_factory,
52 ) {
53 $this->path_factory = $path_factory;
54 $this->navigator_factory = $navigator_factory;
55 $this->structure = $structure;
56 }
57
63 final protected function addTagToElement(
64 TagInterface $tag,
66 ): void {
67 $this->tag_assignments[] = new TagAssignment(
68 $this->path_factory->toElement($element),
69 $tag
70 );
71 }
72
76 final protected function getTagAssignments(): \Generator
77 {
78 yield from $this->tag_assignments;
79 }
80
81 final protected function getStructure(): StructureSetInterface
82 {
83 return $this->structure;
84 }
85}
$structure
TOTAL STRUCTURE.
__construct(PathFactoryInterface $path_factory, NavigatorFactoryInterface $navigator_factory, StructureSetInterface $structure)
addTagToElement(TagInterface $tag, StructureElementInterface $element)
When indices are added, the tag applies only to copies of the element with those indices (beginning w...
NavigatorFactoryInterface $navigator_factory
only needed to instantiate dictionaries, which is done in inheritors