ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 
32 class Services
33 {
35  protected DataInterface $data;
37 
38  protected GlobalContainer $dic;
39  protected DataHelperServices $data_helper_services;
40 
41  public function __construct(
42  GlobalContainer $dic,
43  DataHelperServices $data_helper_services
44  ) {
45  $this->dic = $dic;
46  $this->data_helper_services = $data_helper_services;
47  }
48 
49  public function utilities(): UtilitiesInterface
50  {
51  if (isset($this->utilities)) {
52  return $this->utilities;
53  }
54  return $this->utilities = new Utilities(
55  $this->dic->language(),
56  $this->dic->user()
57  );
58  }
59 
60  public function data(): DataInterface
61  {
62  if (isset($this->data)) {
63  return $this->data;
64  }
65  return $this->data = new Data(
66  $this->utilities(),
67  $this->data_helper_services->dataHelper()
68  );
69  }
70 
71  public function elements(): ElementsInterface
72  {
73  if (isset($this->elements)) {
74  return $this->elements;
75  }
76  return $this->elements = new Elements(
77  $this->utilities()
78  );
79  }
80 }
__construct(GlobalContainer $dic, DataHelperServices $data_helper_services)
Definition: Services.php:41