ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
InternalServices.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\DI\Container as GlobalContainer;
28use ILIAS\MetaData\Repository\Services\Services as RepositoryServices;
29use ILIAS\MetaData\Editor\Services\InternalServices as InternalEditorServices;
34use ILIAS\MetaData\DataHelper\Services\Services as DataHelperServices;
38
40{
41 protected Actions $actions;
48
49 public function __construct(
50 protected GlobalContainer $dic,
51 protected PathServices $path_services,
52 protected RepositoryServices $repository_services,
53 protected InternalEditorServices $internal_editor_services,
54 protected DataHelperServices $data_helper_services
55 ) {
56 }
57
58 public function dataFinder(): DataFinder
59 {
60 return $this->data_finder ??= new DataFinder();
61 }
62
63 public function inputFactory(): InputFactory
64 {
65 if (isset($this->input_factory)) {
67 }
68 $field_factory = $this->dic->ui()->factory()->input()->field();
69 $refinery = $this->dic->refinery();
70 $presenter = $this->internal_editor_services->presenter();
71 $path_factory = $this->path_services->pathFactory();
72 $vocabulary_adapter = $this->internal_editor_services->vocabularyAdapter();
73 return $this->input_factory = new InputFactory(
74 $field_factory,
76 $presenter,
77 $path_factory,
78 $this->dataFinder(),
79 $this->repository_services->databaseDictionary(),
81 $field_factory,
82 $presenter,
83 $this->repository_services->constraintDictionary(),
85 $path_factory,
86 $this->data_helper_services->dataHelper(),
87 $vocabulary_adapter
88 ),
89 $vocabulary_adapter
90 );
91 }
92
94 {
95 return $this->properties_fetcher ??= new PropertiesFetcher(
96 $this->internal_editor_services->dictionary(),
97 $this->internal_editor_services->presenter(),
98 $this->dataFinder()
99 );
100 }
101
102 public function actions(): Actions
103 {
104 if (isset($this->actions)) {
105 return $this->actions;
106 }
107 $ui_factory = $this->dic->ui()->factory();
108 $presenter = $this->internal_editor_services->presenter();
109 $link_provider = $this->linkProvider();
110 return $this->actions = new Actions(
112 new ButtonFactory(
113 $ui_factory,
114 $presenter
115 ),
116 new ModalFactory(
118 $ui_factory,
119 $presenter,
120 $this->propertiesFetcher(),
121 $this->formFactory(),
122 $this->repository_services->constraintDictionary(),
123 $this->path_services->pathFactory()
124 )
125 );
126 }
127
128 public function formFactory(): FormFactory
129 {
130 return $this->form_factory ??= new FormFactory(
131 $this->dic->ui()->factory(),
132 $this->linkProvider(),
133 $this->inputFactory(),
134 $this->internal_editor_services->dictionary(),
135 $this->path_services->navigatorFactory()
136 );
137 }
138
139 public function tableFactory(): TableFactory
140 {
141 return $this->table_factory ??= new TableFactory(
142 $this->dic->ui()->factory(),
143 $this->dic->ui()->renderer(),
144 $this->internal_editor_services->presenter(),
145 $this->dataFinder(),
146 $this->actions()->getButton()
147 );
148 }
149
150 protected function linkProvider(): LinkProvider
151 {
152 return $this->link_provider ??= new LinkProvider(
153 $this->internal_editor_services->linkFactory(),
154 $this->path_services->pathFactory()
155 );
156 }
157}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
__construct(protected GlobalContainer $dic, protected PathServices $path_services, protected RepositoryServices $repository_services, protected InternalEditorServices $internal_editor_services, protected DataHelperServices $data_helper_services)
$dic
Definition: ltiresult.php:33