ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
DictionaryInitiator.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
30 
31 abstract class DictionaryInitiator
32 {
34 
40 
42 
46  private array $tag_assignments = [];
47 
48  public function __construct(
49  PathFactoryInterface $path_factory,
50  NavigatorFactoryInterface $navigator_factory,
51  StructureSetInterface $structure
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  {
79  }
80 
81  final protected function getStructure(): StructureSetInterface
82  {
83  return $this->structure;
84  }
85 }
__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