You are here

public function FieldsHelperInterface::compareFieldLabels in Search API 8

Compares two fields for alphabetic sorting according to their labels.

Parameters

\Drupal\search_api\Item\FieldInterface $a: The first field.

\Drupal\search_api\Item\FieldInterface $b: The second field.

Return value

int -1, 0 or 1 if the first field should, respectively, be considered less than, equal to or greater than the second.

1 method overrides FieldsHelperInterface::compareFieldLabels()
FieldsHelper::compareFieldLabels in src/Utility/FieldsHelper.php
Compares two fields for alphabetic sorting according to their labels.

File

src/Utility/FieldsHelperInterface.php, line 272

Class

FieldsHelperInterface
Provides an interface for implementations of the fields helper service.

Namespace

Drupal\search_api\Utility

Code

public function compareFieldLabels(FieldInterface $a, FieldInterface $b);