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
26use ILIAS\DI\Container as GlobalContainer;
30use ILIAS\MetaData\DataHelper\Services\Services as DataHelperServices;
31use ILIAS\MetaData\Vocabularies\Services\Services as VocabulariesServices;
32
34{
38
39 protected GlobalContainer $dic;
40 protected DataHelperServices $data_helper_services;
41 protected VocabulariesServices $vocabularies_services;
42
43 public function __construct(
44 GlobalContainer $dic,
45 DataHelperServices $data_helper_services,
46 VocabulariesServices $vocabularies_services
47 ) {
48 $this->dic = $dic;
49 $this->data_helper_services = $data_helper_services;
50 $this->vocabularies_services = $vocabularies_services;
51 }
52
53 public function utilities(): UtilitiesInterface
54 {
55 if (isset($this->utilities)) {
56 return $this->utilities;
57 }
58 return $this->utilities = new Utilities(
59 $this->dic->language(),
60 $this->dic->user(),
61 $this->dic->refinery()
62 );
63 }
64
65 public function data(): DataInterface
66 {
67 if (isset($this->data)) {
68 return $this->data;
69 }
70 return $this->data = new Data(
71 $this->utilities(),
72 $this->data_helper_services->dataHelper(),
73 $this->vocabularies_services->presentation()
74 );
75 }
76
77 public function elements(): ElementsInterface
78 {
79 if (isset($this->elements)) {
80 return $this->elements;
81 }
82 return $this->elements = new Elements(
83 $this->utilities()
84 );
85 }
86}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
__construct(GlobalContainer $dic, DataHelperServices $data_helper_services, VocabulariesServices $vocabularies_services)
Definition: Services.php:43