ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Services.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30use ILIAS\DI\Container as GlobalContainer;
32use ILIAS\MetaData\Structure\Services\Services as StructureServices;
38use ILIAS\Data\Factory as DataFactory;
41use ILIAS\MetaData\Repository\Services\Services as RepositoryServices;
44use ILIAS\MetaData\Manipulator\Services\Services as ManipulatorServices;
45use ILIAS\MetaData\Presentation\Services\Services as PresentationServices;
46use ILIAS\MetaData\Vocabularies\Services\Services as VocabulariesServices;
47use ILIAS\MetaData\Editor\Vocabulary\AdapterInterface as VocabularyAdapterInterface;
48use ILIAS\MetaData\Editor\Vocabulary\Adapter as VocabularyAdapter;
49
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
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)) {
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}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Builds data types.
Definition: Factory.php:36
ObserverHandlerInterface $observer_handler
Definition: Services.php:56
ManipulatorInterface $manipulator
Definition: Services.php:57
LinkFactoryInterface $link_factory
Definition: Services.php:54
RepositoryServices $repository_services
Definition: Services.php:63
ManipulatorServices $manipulator_services
Definition: Services.php:64
VocabulariesServices $vocabularies_services
Definition: Services.php:66
__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
VocabularyAdapterInterface $vocabulary_adapter
Definition: Services.php:58
PresentationServices $presentation_services
Definition: Services.php:65
RequestParserInterface $request_parser
Definition: Services.php:55