ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
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 
24 use ILIAS\MetaData\Search\Services\Services as SearchServices;
25 use ILIAS\MetaData\Paths\Services\Services as PathsServices;
35 
36 class Services
37 {
42 
43  protected GlobalContainer $dic;
44  protected SearchServices $search_services;
45  protected PathsServices $paths_services;
46 
47  public function __construct(
48  GlobalContainer $dic,
49  SearchServices $repository_services,
50  PathsServices $paths_services,
51  ) {
52  $this->dic = $dic;
53  $this->search_services = $repository_services;
54  $this->paths_services = $paths_services;
55  }
56 
57  public function repository(): RepositoryInterface
58  {
59  if (isset($this->repository)) {
60  return $this->repository;
61  }
62  return $this->repository = new DatabaseRepository(
63  new Wrapper($this->dic->database())
64  );
65  }
66 
67  public function renderer(): RendererInterface
68  {
69  if (isset($this->renderer)) {
70  return $this->renderer;
71  }
72  return $this->renderer = new Renderer(
73  $this->dic->ui()->factory(),
74  $this->dic->resourceStorage()
75  );
76  }
77 
79  {
80  if (isset($this->handler)) {
81  return $this->handler;
82  }
83  return $this->handler = new Handler();
84  }
85 
86  public function searcherFactory(): FactoryInterface
87  {
88  if (isset($this->searcher_factory)) {
90  }
91  return $this->searcher_factory = new Factory(
92  $this->search_services->searchFilterFactory(),
93  $this->search_services->searchClauseFactory(),
94  $this->paths_services->pathFactory(),
95  $this->identifiersHandler()
96  );
97  }
98 }
__construct(GlobalContainer $dic, SearchServices $repository_services, PathsServices $paths_services,)
Definition: Services.php:47