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 
30 use ILIAS\MetaData\DataHelper\Services\Services as DataHelperServices;
31 use ILIAS\MetaData\Vocabularies\Services\Services as VocabulariesServices;
32 
33 class Services
34 {
36  protected DataInterface $data;
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 }
__construct(GlobalContainer $dic, DataHelperServices $data_helper_services, VocabulariesServices $vocabularies_services)
Definition: Services.php:43