You are here

public function DateFieldHandler::getOperators in CRM Core 8.3

Same name and namespace in other branches
  1. 8 modules/crm_core_match/src/Plugin/crm_core_match/field/DateFieldHandler.php \Drupal\crm_core_match\Plugin\crm_core_match\field\DateFieldHandler::getOperators()
  2. 8.2 modules/crm_core_match/src/Plugin/crm_core_match/field/DateFieldHandler.php \Drupal\crm_core_match\Plugin\crm_core_match\field\DateFieldHandler::getOperators()

Gets the operators.

Defines the logical operators that can be used by this field type. Provides any additional fields needed to capture information used in logical evaluations. See {@code QueryInterface::condition} for valid operators.

For instance: if this was a text field, there might be 4 logical operators: =, STARTS_WITH, ENDS_WITH and CONTAINS.

Parameters

string $property: The name of the property.

Return value

string[] Array of operators, with the operator name as key and the translated operator label as value.

Overrides FieldHandlerInterface::getOperators

File

modules/crm_core_match/src/Plugin/crm_core_match/field/DateFieldHandler.php, line 18

Class

DateFieldHandler
Class for evaluating date fields.

Namespace

Drupal\crm_core_match\Plugin\crm_core_match\field

Code

public function getOperators($property = 'value') {
  $operators = [
    '=' => $this
      ->t('Equals'),
    '>=' => $this
      ->t('Greater than'),
    '<=' => $this
      ->t('Less than'),
  ];
  return $operators;
}