CoolCMS API

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

$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|null

buildRegionSubtreeFilters()

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

LanguageContext returns a real entity (never a proxy)

Return values
Filter

prepareParameterFilter()

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_AGAINST fallback), so a second DB fulltext would be a pointless extra query and would narrow the result differently than ES.

resolveAddressDistancePreferRegionId()

The country of the website localization takes precedence in the dataset match (same as in the suggest).

private resolveAddressDistancePreferRegionId() : int|null
Return values
int|null

resolveCoordinateParamIds()

private resolveCoordinateParamIds() : array{0: ?int, 1: ?int}
Return values
array{0: ?int, 1: ?int} —

[latParamId, lonParamId]

On this page

Search results