ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
31 use ILIAS\MetaData\Paths\Services\Services as PathServices;
32 use ILIAS\MetaData\Structure\Services\Services as StructureServices;
41 use ILIAS\MetaData\Repository\Services\Services as RepositoryServices;
44 use ILIAS\MetaData\Manipulator\Services\Services as ManipulatorServices;
45 use ILIAS\MetaData\Presentation\Services\Services as PresentationServices;
46 use ILIAS\MetaData\Vocabularies\Services\Services as VocabulariesServices;
47 use ILIAS\MetaData\Editor\Vocabulary\AdapterInterface as VocabularyAdapterInterface;
48 use ILIAS\MetaData\Editor\Vocabulary\Adapter as VocabularyAdapter;
49 
50 class Services
51 {
58  protected VocabularyAdapterInterface $vocabulary_adapter;
59 
60  protected GlobalContainer $dic;
61  protected PathServices $path_services;
62  protected StructureServices $structure_services;
63  protected RepositoryServices $repository_services;
64  protected ManipulatorServices $manipulator_services;
65  protected PresentationServices $presentation_services;
66  protected VocabulariesServices $vocabularies_services;
67 
68  public function __construct(
69  GlobalContainer $dic,
70  PathServices $path_services,
71  StructureServices $structure_services,
72  RepositoryServices $repository_services,
73  ManipulatorServices $manipulator_services,
74  PresentationServices $presentation_services,
75  VocabulariesServices $vocabularies_services
76  ) {
77  $this->dic = $dic;
78  $this->path_services = $path_services;
79  $this->structure_services = $structure_services;
80  $this->repository_services = $repository_services;
81  $this->manipulator_services = $manipulator_services;
82  $this->presentation_services = $presentation_services;
83  $this->vocabularies_services = $vocabularies_services;
84  }
85 
86  public function presenter(): PresenterInterface
87  {
88  if (isset($this->presenter)) {
89  return $this->presenter;
90  }
91  return $this->presenter = new Presenter(
92  $utilities = new Utilities(
93  $this->presentation_services->utilities()
94  ),
95  $data = new Data(
96  $this->presentation_services->utilities(),
97  $this->presentation_services->data(),
98  $this->vocabularies_services->presentation()
99  ),
100  new Elements(
101  $data,
102  $this->dictionary(),
103  $this->path_services->navigatorFactory(),
104  $this->presentation_services->elements()
105  ),
106  );
107  }
108 
109  public function dictionary(): DictionaryInterface
110  {
111  if (isset($this->dictionary)) {
112  return $this->dictionary;
113  }
114  return $this->dictionary = (new LOMDictionaryInitiator(
115  new TagFactory($this->path_services->pathFactory()),
116  $this->path_services->pathFactory(),
117  $this->path_services->navigatorFactory(),
118  $this->structure_services->structure()
119  ))->get();
120  }
121 
123  {
124  if (isset($this->link_factory)) {
125  return $this->link_factory;
126  }
127  return $this->link_factory = new LinkFactory(
128  $this->dic->ctrl(),
129  new DataFactory()
130  );
131  }
132 
134  {
135  if (isset($this->request_parser)) {
136  return $this->request_parser;
137  }
138  return $this->request_parser = new RequestParser(
139  $this->dic->http(),
140  $this->dic->refinery(),
141  $this->path_services->pathFactory()
142  );
143  }
144 
146  {
147  if (isset($this->manipulator)) {
148  return $this->manipulator;
149  }
150  return $this->manipulator = new Manipulator(
151  $this->manipulator_services->manipulator(),
152  $this->path_services->navigatorFactory(),
153  $this->repository_services->repository(),
154  $this->manipulator_services->scaffoldProvider()
155  );
156  }
157 
159  {
160  if (isset($this->observer_handler)) {
162  }
163  return $this->observer_handler = new ObserverHandler();
164  }
165 
166  public function vocabularyAdapter(): VocabularyAdapterInterface
167  {
168  if (isset($this->vocabulary_adapter)) {
170  }
171  return $this->vocabulary_adapter = new VocabularyAdapter(
172  $this->vocabularies_services->reader(),
173  $this->vocabularies_services->slotElementHelper()
174  );
175  }
176 }
RequestParserInterface $request_parser
Definition: Services.php:55
ObserverHandlerInterface $observer_handler
Definition: Services.php:56
ManipulatorInterface $manipulator
Definition: Services.php:57
PresentationServices $presentation_services
Definition: Services.php:65
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
VocabularyAdapterInterface $vocabulary_adapter
Definition: Services.php:58
__construct(GlobalContainer $dic, PathServices $path_services, StructureServices $structure_services, RepositoryServices $repository_services, ManipulatorServices $manipulator_services, PresentationServices $presentation_services, VocabulariesServices $vocabularies_services)
Definition: Services.php:68
VocabulariesServices $vocabularies_services
Definition: Services.php:66
LinkFactoryInterface $link_factory
Definition: Services.php:54
RepositoryServices $repository_services
Definition: Services.php:63
ManipulatorServices $manipulator_services
Definition: Services.php:64