Copied!

Field

Field.php : 27
Extends SortClause

Sets sort direction on a field value for a content query.

Note: for fields of some field types order will vary per search engine. This comes from the different way of storing IDs in the search backend, and therefore relates to the field types that store ID value for sorting (Relation field type). For Legacy search engine IDs are stored as integers, while with Solr search engine they are stored as strings. In that case the difference will be basically the one between numerical and alphabetical order of sorting.

This reflects API definition of IDs as mixed type (integer or string).

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

Field.php : 34

Custom fields to sort by instead of the default field.

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

Methods

public__construct()

Field.php : 43

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

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

Parameters

Name Type Default value Description
$typeIdentifier string - -
$fieldIdentifier string - -
$sortDirection string Query::SORT_ASC -

publicgetCustomField()

Field.php : 76

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()

Field.php : 61

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