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

Core/Repository/SiteAccessAware/SearchService.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\Repository\SiteAccessAware;
8
9 use eZ\Publish\API\Repository\SearchService as SearchServiceInterface;
10 use eZ\Publish\API\Repository\Values\Content\Query;
11 use eZ\Publish\API\Repository\Values\Content\LocationQuery;
12 use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
13 use eZ\Publish\API\Repository\LanguageResolver;
14
18 class SearchService implements SearchServiceInterface
19 {
21 protected $service;
22
24 protected $languageResolver;
25
32 public function __construct(
33 SearchServiceInterface $service,
34 LanguageResolver $languageResolver
35 ) {
36 $this->service = $service;
37 $this->languageResolver = $languageResolver;
38 }
39
40 public function findContent(Query $query, array $languageFilter = [], $filterOnUserPermissions = true)
41 {
42 $languageFilter['languages'] = $this->languageResolver->getPrioritizedLanguages(
43 $languageFilter['languages'] ?? null
44 );
45
46 $languageFilter['useAlwaysAvailable'] = $this->languageResolver->getUseAlwaysAvailable(
47 $languageFilter['useAlwaysAvailable'] ?? null
48 );
49
50 return $this->service->findContent($query, $languageFilter, $filterOnUserPermissions);
51 }
52
53 public function findContentInfo(Query $query, array $languageFilter = [], $filterOnUserPermissions = true)
54 {
55 $languageFilter['languages'] = $this->languageResolver->getPrioritizedLanguages(
56 $languageFilter['languages'] ?? null
57 );
58
59 $languageFilter['useAlwaysAvailable'] = $this->languageResolver->getUseAlwaysAvailable(
60 $languageFilter['useAlwaysAvailable'] ?? null
61 );
62
63 return $this->service->findContentInfo($query, $languageFilter, $filterOnUserPermissions);
64 }
65
66 public function findSingle(Criterion $filter, array $languageFilter = [], $filterOnUserPermissions = true)
67 {
68 $languageFilter['languages'] = $this->languageResolver->getPrioritizedLanguages(
69 $languageFilter['languages'] ?? null
70 );
71
72 $languageFilter['useAlwaysAvailable'] = $this->languageResolver->getUseAlwaysAvailable(
73 $languageFilter['useAlwaysAvailable'] ?? null
74 );
75
76 return $this->service->findSingle($filter, $languageFilter, $filterOnUserPermissions);
77 }
78
79 public function suggest($prefix, $fieldPaths = [], $limit = 10, Criterion $filter = null)
80 {
81 return $this->service->suggest($prefix, $fieldPaths, $limit, $filter);
82 }
83
84 public function findLocations(LocationQuery $query, array $languageFilter = [], $filterOnUserPermissions = true)
85 {
86 $languageFilter['languages'] = $this->languageResolver->getPrioritizedLanguages(
87 $languageFilter['languages'] ?? null
88 );
89
90 $languageFilter['useAlwaysAvailable'] = $this->languageResolver->getUseAlwaysAvailable(
91 $languageFilter['useAlwaysAvailable'] ?? null
92 );
93
94 return $this->service->findLocations($query, $languageFilter, $filterOnUserPermissions);
95 }
96
97 public function supports($capabilityFlag)
98 {
99 return $this->service->supports($capabilityFlag);
100 }
101 }
eZ\Publish\API\Repository\Values\Content\LocationQuery
This class is used to perform a Location query.
Definition: API/Repository/Values/Content/LocationQuery.php:13
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion.php:15
eZ\Publish\API\Repository\Values\Content\Query
This class is used to perform a Content query.
Definition: API/Repository/Values/Content/Query.php:15
eZ\Publish\Core\Repository\SiteAccessAware\SearchService
SiteAccess aware implementation of SearchService injecting languages where needed.
Definition: Core/Repository/SiteAccessAware/SearchService.php:19
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\findSingle
findSingle(Criterion $filter, array $languageFilter=[], $filterOnUserPermissions=true)
Performs a query for a single content object.
Definition: Core/Repository/SiteAccessAware/SearchService.php:66
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\findLocations
findLocations(LocationQuery $query, array $languageFilter=[], $filterOnUserPermissions=true)
Finds Locations for the given query.
Definition: Core/Repository/SiteAccessAware/SearchService.php:84
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\findContent
findContent(Query $query, array $languageFilter=[], $filterOnUserPermissions=true)
Finds content objects for the given query.
Definition: Core/Repository/SiteAccessAware/SearchService.php:40
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\$languageResolver
$languageResolver
Definition: Core/Repository/SiteAccessAware/SearchService.php:24
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\__construct
__construct(SearchServiceInterface $service, LanguageResolver $languageResolver)
Construct service object from aggregated service and LanguageResolver.
Definition: Core/Repository/SiteAccessAware/SearchService.php:32
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\$service
$service
Definition: Core/Repository/SiteAccessAware/SearchService.php:21
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\suggest
suggest($prefix, $fieldPaths=[], $limit=10, Criterion $filter=null)
Suggests a list of values for the given prefix.
Definition: Core/Repository/SiteAccessAware/SearchService.php:79
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\findContentInfo
findContentInfo(Query $query, array $languageFilter=[], $filterOnUserPermissions=true)
Finds contentInfo objects for the given query.
Definition: Core/Repository/SiteAccessAware/SearchService.php:53
eZ\Publish\Core\Repository\SiteAccessAware\SearchService\supports
supports($capabilityFlag)
Query for supported capability of currently configured search engine.
Definition: Core/Repository/SiteAccessAware/SearchService.php:97
eZ\Publish\API\Repository\LanguageResolver
Resolve language settings for Repository layer.
Definition: Publish/API/Repository/LanguageResolver.php:15
eZ\Publish\API\Repository\SearchService
Search service.
Definition: API/Repository/SearchService.php:17
eZ\Publish\API\Repository\Values\Content\Query\Criterion
Definition: API/Repository/Values/Content/Query/Criterion/Ancestor.php:7
eZ\Publish\Core\Repository\SiteAccessAware
Definition: Core/Repository/SiteAccessAware/ContentService.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.