ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
Service.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\Search\Presentation\Service\Service as PresentationService;
28use ILIAS\Search\GUI\Lucene\SearchStateHandlerImpl as LuceneSearchStateHandlerImpl;
29use ILIAS\Search\GUI\Direct\SearchStateHandlerImpl as DirectSearchStateHandlerImpl;
31use ILIAS\Search\GUI\Lucene\SearcherImpl as LuceneSearcherImpl;
32use ILIAS\Search\GUI\Direct\SearcherImpl as DirectSearcherImpl;
33use ILIAS\Data\Factory as DataFactory;
35
37{
38 protected Actions $actions;
43
44 public function __construct(
45 protected Container $dic,
46 protected PresentationService $presentation_service
47 ) {
48 }
49
50 public function actions(): Actions
51 {
52 return $this->actions ??= new ActionsImpl(
53 $this->dic->ctrl(),
54 new DataFactory()
55 );
56 }
57
59 {
60 return $this->lucene_search_state_handler ??= new LuceneSearchStateHandlerImpl(
62 $this->dic->learningObjectMetadata(),
63 $this->dic->http(),
64 $this->dic->refinery()
65 );
66 }
67
69 {
70 return $this->direct_search_state_handler ??= new DirectSearchStateHandlerImpl(
72 $this->dic->learningObjectMetadata(),
73 $this->dic->http(),
74 $this->dic->refinery()
75 );
76 }
77
78 public function luceneSearcher(): Searcher
79 {
80 return $this->lucene_searcher ??= new LuceneSearcherImpl(
82 $this->dic->ui()->mainTemplate(),
83 $this->dic->ui()->renderer(),
84 $this->presentation_service->result(),
85 $this->dic->language()
86 );
87 }
88
89 public function directSearcher(): Searcher
90 {
91 return $this->direct_searcher ??= new DirectSearcherImpl(
93 $this->dic->ui()->mainTemplate(),
94 $this->dic->ui()->renderer(),
95 $this->presentation_service->result(),
96 $this->dic->language()
97 );
98 }
99}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Builds data types.
Definition: Factory.php:36
SearchStateHandler $lucene_search_state_handler
Definition: Service.php:39
__construct(protected Container $dic, protected PresentationService $presentation_service)
Definition: Service.php:44
SearchStateHandler $direct_search_state_handler
Definition: Service.php:40
Until there is a unified format for search results, rendering also has to be done seperately.
Definition: Searcher.php:31
$dic
Definition: ltiresult.php:33