CoolCMS API

AddressDistanceFilterTrait

"Within X km of" filter (ADDRESS_DISTANCE) of the advert listing, shared by Bazaar and Comcat.

URL: p[<id>] text, p[<id>_d] km (default 25), p[<id>_r] region from the suggest. The point is computed by GeocodingManager::resolveSearchPoint() (region, dataset, cache, Google); without a point, or without latitude/longitude parameters in the module, a text match on the address applies.

The host (listing presenter) needs the $parameterManager of its module (Front, fluent findAll).

Table of Contents

Properties

$geocodingManager  : GeocodingManager
$addressDistanceCoordinateParamIds  : array{0: ?int, 1: ?int}|null

Methods

buildAddressDistanceFilter()  : BaseFilter|null
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

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