ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 use ILIAS\MetaData\Paths\Services\Services as PathServices;
28 use ILIAS\MetaData\Repository\Services\Services as RepositoryServices;
29 use ILIAS\MetaData\Editor\Services\Services as EditorServices;
30 use ILIAS\MetaData\Vocabularies\Services\Services as VocabulariesServices;
35 use ILIAS\MetaData\Manipulator\Services\Services as ManipulatorServices;
36 use ILIAS\MetaData\DataHelper\Services\Services as DataHelperServices;
37 
38 class Services
39 {
40  protected Actions $actions;
48 
49  protected GlobalContainer $dic;
50  protected PathServices $path_services;
51  protected RepositoryServices $repository_services;
52  protected VocabulariesServices $vocabularies_services;
53  protected EditorServices $editor_services;
54  protected ManipulatorServices $manipulator_services;
55  protected DataHelperServices $data_helper_services;
56 
57  public function __construct(
58  GlobalContainer $dic,
59  PathServices $path_services,
60  RepositoryServices $repository_services,
61  VocabulariesServices $vocabularies_services,
62  ManipulatorServices $manipulator_services,
63  EditorServices $editor_services,
64  DataHelperServices $data_helper_services
65  ) {
66  $this->dic = $dic;
67  $this->path_services = $path_services;
68  $this->repository_services = $repository_services;
69  $this->vocabularies_services = $vocabularies_services;
70  $this->editor_services = $editor_services;
71  $this->manipulator_services = $manipulator_services;
72  $this->data_helper_services = $data_helper_services;
73  }
74 
75  public function dataFinder(): DataFinder
76  {
77  if (isset($this->data_finder)) {
78  return $this->data_finder;
79  }
80  return $this->data_finder = new DataFinder();
81  }
82 
83  public function inputFactory(): InputFactory
84  {
85  if (isset($this->input_factory)) {
86  return $this->input_factory;
87  }
88  $field_factory = $this->dic->ui()->factory()->input()->field();
89  $refinery = $this->dic->refinery();
90  $presenter = $this->editor_services->presenter();
91  $path_factory = $this->path_services->pathFactory();
92  $element_vocab_helper = $this->vocabularies_services->elementHelper();
93  return $this->input_factory = new InputFactory(
94  $field_factory,
95  $refinery,
96  $presenter,
97  $path_factory,
98  $this->dataFinder(),
99  $this->repository_services->databaseDictionary(),
101  $field_factory,
102  $presenter,
103  $this->repository_services->constraintDictionary(),
104  $refinery,
105  $path_factory,
106  $this->data_helper_services->dataHelper(),
107  $element_vocab_helper,
108  $this->vocabularies_services->slotHandler()
109  ),
110  $element_vocab_helper
111  );
112  }
113 
115  {
116  if (isset($this->properties_fetcher)) {
118  }
119  return $this->properties_fetcher = new PropertiesFetcher(
120  $this->editor_services->dictionary(),
121  $this->editor_services->presenter(),
122  $this->dataFinder()
123  );
124  }
125 
126  public function actions(): Actions
127  {
128  if (isset($this->actions)) {
129  return $this->actions;
130  }
131  $ui_factory = $this->dic->ui()->factory();
132  $presenter = $this->editor_services->presenter();
133  $link_provider = $this->linkProvider();
134  return $this->actions = new Actions(
135  $link_provider,
136  new ButtonFactory(
137  $ui_factory,
138  $presenter
139  ),
140  new ModalFactory(
141  $link_provider,
142  $ui_factory,
143  $presenter,
144  $this->propertiesFetcher(),
145  $this->formFactory(),
146  $this->repository_services->constraintDictionary(),
147  $this->path_services->pathFactory()
148  )
149  );
150  }
151 
152  public function formFactory(): FormFactory
153  {
154  if (isset($this->form_factory)) {
155  return $this->form_factory;
156  }
157  return $this->form_factory = new FormFactory(
158  $this->dic->ui()->factory(),
159  $this->linkProvider(),
160  $this->inputFactory(),
161  $this->editor_services->dictionary(),
162  $this->path_services->navigatorFactory()
163  );
164  }
165 
166  public function tableFactory(): TableFactory
167  {
168  if (isset($this->table_factory)) {
169  return $this->table_factory;
170  }
171  return $this->table_factory = new TableFactory(
172  $this->dic->ui()->factory(),
173  $this->dic->ui()->renderer(),
174  $this->editor_services->presenter(),
175  $this->dataFinder(),
176  $this->actions()->getButton()
177  );
178  }
179 
181  {
182  if (isset($this->manipulator_adapter)) {
184  }
185  return $this->manipulator_adapter = new ManipulatorAdapter(
186  $this->editor_services->manipulator(),
187  $this->formFactory(),
188  $this->path_services->pathFactory(),
189  $this->path_services->navigatorFactory()
190  );
191  }
192 
193  protected function linkProvider(): LinkProvider
194  {
195  if (isset($this->link_provider)) {
196  return $this->link_provider;
197  }
198  return $this->link_provider = new LinkProvider(
199  $this->editor_services->linkFactory(),
200  $this->path_services->pathFactory()
201  );
202  }
203 }
VocabulariesServices $vocabularies_services
Definition: Services.php:52
__construct(GlobalContainer $dic, PathServices $path_services, RepositoryServices $repository_services, VocabulariesServices $vocabularies_services, ManipulatorServices $manipulator_services, EditorServices $editor_services, DataHelperServices $data_helper_services)
Definition: Services.php:57