ParameterTrait uses trait:short
Table of Contents
Properties
- $geocodingManager : GeocodingManager
- $addressDistanceCoordinateParamIds : array{0: ?int, 1: ?int}|null
Methods
- buildAddressDistanceFilter() : BaseFilter|null
- buildRegionSubtreeFilters() : array<string|int, BaseFilter>
- Builds the "in region" filter from the suggest (`REGION_PICKER`, `p[<id>]=<regionId>`): adverts whose region lies in the subtree of the selected node, so a county also finds the adverts of its municipalities. Same shape as the list by the region in the path ({@see RegionTrait::prepareRegionFilter()}). A nonexistent region means no filter (an invalid id from the URL must not hide the whole list).
- extractBaseParameterIds() : array<string|int, int>
- Extracts the unique base `parameterId` from the URL keys (strips the suffixes `_from`, `_to`, `_d`, `_r`).
- prepareAdvertSearchFilter() : Filter
- Builds the fulltext filter through ES (ids become `SearchIdFilter`; visibility and paging stay in DB phase 1). When ES is off, down or the query is short, it transparently falls back to MySQL `MATCH_AGAINST` over `parameterRels.value`.
- prepareParameterFilter() : void
- resolveAddressDistanceLanguageId() : int
- resolveAddressDistancePreferRegionId() : int|null
- The country of the website localization takes precedence in the dataset match (same as in the suggest).
- resolveCoordinateParamIds() : array{0: ?int, 1: ?int}
Properties
$geocodingManager
public
GeocodingManager
$geocodingManager
Attributes
- #[Inject]
$addressDistanceCoordinateParamIds
private
array{0: ?int, 1: ?int}|null
$addressDistanceCoordinateParamIds
= null
[latParamId, lonParamId], resolved once per request
Methods
buildAddressDistanceFilter()
private
buildAddressDistanceFilter(int $parameterId, array<int|string, mixed> $urlParams) : BaseFilter|null
Parameters
- $parameterId : int
- $urlParams : array<int|string, mixed>
Return values
BaseFilter|nullbuildRegionSubtreeFilters()
Builds the "in region" filter from the suggest (`REGION_PICKER`, `p[<id>]=<regionId>`): adverts whose region lies in the subtree of the selected node, so a county also finds the adverts of its municipalities. Same shape as the list by the region in the path ({@see RegionTrait::prepareRegionFilter()}). A nonexistent region means no filter (an invalid id from the URL must not hide the whole list).
private
buildRegionSubtreeFilters(int|null $parameterId, array<int|string, mixed> $urlParams) : array<string|int, BaseFilter>
Parameters
- $parameterId : int|null
- $urlParams : array<int|string, mixed>
Return values
array<string|int, BaseFilter>extractBaseParameterIds()
Extracts the unique base `parameterId` from the URL keys (strips the suffixes `_from`, `_to`, `_d`, `_r`).
private
extractBaseParameterIds(array<string|int, mixed> $urlParams) : array<string|int, int>
Parameters
- $urlParams : array<string|int, mixed>
Return values
array<string|int, int>prepareAdvertSearchFilter()
Builds the fulltext filter through ES (ids become `SearchIdFilter`; visibility and paging stay in DB phase 1). When ES is off, down or the query is short, it transparently falls back to MySQL `MATCH_AGAINST` over `parameterRels.value`.
private
prepareAdvertSearchFilter(string $search, object $language) : Filter
Parameters
- $search : string
- $language : object
-
LanguageContextreturns a real entity (never a proxy)
Return values
FilterprepareParameterFilter()
private
prepareParameterFilter(array<int, Filter> &$filters[, bool $withSearch = true ]) : void
Parameters
- $filters : array<int, Filter>
- $withSearch : bool = true
-
false= do not add the fulltext filter, only the parameter filters ($_GET['p']). The search endpoint uses it: the Api side does the search there (ES relevance,MATCH_AGAINSTfallback), so a second DB fulltext would be a pointless extra query and would narrow the result differently than ES.
resolveAddressDistanceLanguageId()
private
resolveAddressDistanceLanguageId() : int
Return values
intresolveAddressDistancePreferRegionId()
The country of the website localization takes precedence in the dataset match (same as in the suggest).
private
resolveAddressDistancePreferRegionId() : int|null
Return values
int|nullresolveCoordinateParamIds()
private
resolveCoordinateParamIds() : array{0: ?int, 1: ?int}
Return values
array{0: ?int, 1: ?int} —[latParamId, lonParamId]