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
28use ILIAS\MetaData\Repository\Dictionary\LOMDictionaryInitiator as RepositoryDictionaryInitiator;
31use ILIAS\MetaData\Structure\Services\Services as StructureServices;
32use ILIAS\MetaData\Repository\Dictionary\TagFactory as RepositoryTagFactory;
34use ILIAS\MetaData\Elements\Factory as ElementFactory;
36use ILIAS\DI\Container as GlobalContainer;
42use ILIAS\MetaData\Vocabularies\Services\Services as VocabulariesServices;
43use ILIAS\MetaData\DataHelper\Services\Services as DataHelperServices;
50use ILIAS\MetaData\Manipulator\Services\Services as ManipulatorServices;
52
54{
56 protected ValidationDictionary $validation_dictionary;
57 protected RepositoryDictionary $repository_dictionary;
58
59
60 protected GlobalContainer $dic;
61 protected PathServices $path_services;
62 protected StructureServices $structure_services;
63 protected VocabulariesServices $vocabularies_services;
64 protected DataHelperServices $data_helper_services;
65 protected ManipulatorServices $manipulator_services;
66
67 public function __construct(
68 GlobalContainer $dic,
69 PathServices $path_services,
70 StructureServices $structure_services,
71 VocabulariesServices $vocabularies_services,
72 DataHelperServices $data_helper_services,
73 ManipulatorServices $manipulator_services
74 ) {
75 $this->dic = $dic;
76 $this->path_services = $path_services;
77 $this->structure_services = $structure_services;
78 $this->vocabularies_services = $vocabularies_services;
79 $this->data_helper_services = $data_helper_services;
80 $this->manipulator_services = $manipulator_services;
81 }
82
83 public function constraintDictionary(): ValidationDictionary
84 {
85 if (isset($this->validation_dictionary)) {
87 }
88 return $this->validation_dictionary = (new ValidationDictionaryInitiator(
89 new ValidationTagFactory(),
90 $this->path_services->pathFactory(),
91 $this->path_services->navigatorFactory(),
92 $this->structure_services->structure()
93 ))->get();
94 }
95
96 public function databaseDictionary(): RepositoryDictionary
97 {
98 if (isset($this->repository_dictionary)) {
100 }
101 return $this->repository_dictionary = (new RepositoryDictionaryInitiator(
102 new RepositoryTagFactory(),
103 $this->path_services->pathFactory(),
104 $this->path_services->navigatorFactory(),
105 $this->structure_services->structure()
106 ))->get();
107 }
108
110 {
111 if (isset($this->repository)) {
112 return $this->repository;
113 }
114 $logger = $this->dic->logger()->meta();
115 $data_factory = new DataFactory();
116 $querier = new DatabaseQuerier(
117 new ResultFactory(),
118 $this->dic->database(),
119 $logger
120 );
121 $element_factory = new ElementFactory($data_factory);
122 return $this->repository = new LOMDatabaseRepository(
123 $ressource_id_factory = new RessourceIDFactory(),
125 $this->databaseDictionary(),
126 $querier,
127 new AssignmentFactory(),
128 $logger
129 ),
130 new DatabaseReader(
131 $element_factory,
132 $this->structure_services->structure(),
133 $this->databaseDictionary(),
134 $this->path_services->navigatorFactory(),
135 $this->path_services->pathFactory(),
136 $querier,
137 $logger
138 ),
140 $ressource_id_factory,
142 $this->dic->database(),
143 $this->structure_services->structure(),
144 $this->databaseDictionary(),
145 $this->path_services->navigatorFactory()
146 ),
147 $this->dic->database()
148 ),
149 new Processor(
150 $element_factory,
151 new MarkerFactory(),
152 $this->structure_services->structure(),
153 new DataValidator(
154 new DataValidatorService($this->data_helper_services->dataHelper())
155 ),
156 $this->constraintDictionary(),
157 $this->vocabularies_services->slotElementHelper(),
158 $logger
159 ),
161 $this->manipulator_services->manipulator(),
162 $this->path_services->pathFactory()
163 )
164 );
165 }
166}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
VocabulariesServices $vocabularies_services
Definition: Services.php:63
ValidationDictionary $validation_dictionary
Definition: Services.php:56
RepositoryDictionary $repository_dictionary
Definition: Services.php:57
__construct(GlobalContainer $dic, PathServices $path_services, StructureServices $structure_services, VocabulariesServices $vocabularies_services, DataHelperServices $data_helper_services, ManipulatorServices $manipulator_services)
Definition: Services.php:67