Copied!

MapLocationDistance

MapLocationDistance.php : 19
Extends SortClause

Sets sort direction on the MapLocation distance for a content query.

Properties

public $direction

SortClause.php : 26

Sort direction One of Query::SORT_ASC or Query::SORT_DESC;.

public string $direction = \Ibexa\Contracts\Core\Repository\Values\Content\Query::SORT_ASC

public $target

SortClause.php : 33

Sort target, high level: section_identifier, attribute_value, etc.

public string $target

public $targetData

SortClause.php : 40

Extra target data, required by some sort clauses, field for instance.

public Target|null $targetData

protected $customFields

MapLocationDistance.php : 26

Custom fields to sort by instead of the default field.

protected array<string|int, mixed> $customFields = []

Methods

public__construct()

MapLocationDistance.php : 37

Constructs a new MapLocationDistance SortClause on Type $typeIdentifier and Field $fieldIdentifier.

public __construct(string $typeIdentifier, string $fieldIdentifier, float $latitude, float $longitude[, string $sortDirection = Query::SORT_ASC ])

Parameters

Name Type Default value Description
$typeIdentifier string -

ContentType identifier

$fieldIdentifier string -

FieldDefinition identifier

$latitude float -

Latitude of the location that distance is calculated from

$longitude float -

Longitude of the location that distance is calculated from

$sortDirection string Query::SORT_ASC -

publicgetCustomField()

MapLocationDistance.php : 80

Return custom field.

public getCustomField(string $type, string $field) : mixed

If no custom field is set, return null

Parameters

Name Type Default value Description
$type string - -
$field string - -

publicsetCustomField()

MapLocationDistance.php : 65

Set a custom field to sort by.

public setCustomField(string $type, string $field, string $customField) : void

Set a custom field to sort by for a defined field in a defined type.

Parameters

Name Type Default value Description
$type string - -
$field string - -
$customField string - -