Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

SearchEngineIndexerFactory.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\ApiLoader;
8
9 use eZ\Bundle\EzPublishCoreBundle\ApiLoader\Exception\InvalidSearchEngineIndexer;
10 use eZ\Publish\Core\Search\Common\Indexer as SearchEngineIndexer;
11
15 class SearchEngineIndexerFactory
16 {
18 private $repositoryConfigurationProvider;
19
26 protected $searchEngineIndexers = [];
27
28 public function __construct(RepositoryConfigurationProvider $repositoryConfigurationProvider)
29 {
30 $this->repositoryConfigurationProvider = $repositoryConfigurationProvider;
31 }
32
41 public function registerSearchEngineIndexer(SearchEngineIndexer $searchEngineIndexer, $searchEngineIdentifier)
42 {
43 $this->searchEngineIndexers[$searchEngineIdentifier] = $searchEngineIndexer;
44 }
45
51 public function getSearchEngineIndexers()
52 {
53 return $this->searchEngineIndexers;
54 }
55
64 public function buildSearchEngineIndexer()
65 {
66 $repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();
67
68 if (
69 !(
70 isset($repositoryConfig['search']['engine'])
71 && isset($this->searchEngineIndexers[$repositoryConfig['search']['engine']])
72 )
73 ) {
74 throw new InvalidSearchEngineIndexer(
75 "Invalid search engine '{$repositoryConfig['search']['engine']}'. " .
76 "Could not find a service tagged as 'ezpublish.searchEngineIndexer' " .
77 "with alias '{$repositoryConfig['search']['engine']}'."
78 );
79 }
80
81 return $this->searchEngineIndexers[$repositoryConfig['search']['engine']];
82 }
83 }
eZ\Bundle\EzPublishCoreBundle\ApiLoader\Exception\InvalidSearchEngineIndexer
Definition: InvalidSearchEngineIndexer.php:12
eZ\Bundle\EzPublishCoreBundle\ApiLoader\RepositoryConfigurationProvider
The repository configuration provider.
Definition: RepositoryConfigurationProvider.php:16
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory
The search engine indexer factory.
Definition: SearchEngineIndexerFactory.php:16
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory\$searchEngineIndexers
$searchEngineIndexers
Definition: SearchEngineIndexerFactory.php:26
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory\getSearchEngineIndexers
getSearchEngineIndexers()
Returns registered search engine indexers.
Definition: SearchEngineIndexerFactory.php:51
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory\buildSearchEngineIndexer
buildSearchEngineIndexer()
Build search engine indexer identified by its identifier (the "alias" attribute in the service tag),...
Definition: SearchEngineIndexerFactory.php:64
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory\$repositoryConfigurationProvider
$repositoryConfigurationProvider
Definition: SearchEngineIndexerFactory.php:18
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory\registerSearchEngineIndexer
registerSearchEngineIndexer(SearchEngineIndexer $searchEngineIndexer, $searchEngineIdentifier)
Registers $searchEngineIndexer as a valid search engine indexer with identifier $searchEngineIdentifi...
Definition: SearchEngineIndexerFactory.php:41
eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory\__construct
__construct(RepositoryConfigurationProvider $repositoryConfigurationProvider)
Definition: SearchEngineIndexerFactory.php:28
eZ\Publish\Core\Search\Common\Indexer
Base class for the Search Engine Indexer Service aimed to recreate Search Engine Index.
Definition: Common/Indexer.php:23
eZ\Bundle\EzPublishCoreBundle\ApiLoader
Definition: CacheFactory.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.