You are here

class OperatorsHelper in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_server/src/OperatorsHelper.php \Drupal\entity_share_server\OperatorsHelper
  2. 8 modules/entity_share_server/src/OperatorsHelper.php \Drupal\entity_share_server\OperatorsHelper

Defines the Operators helper class.

Hierarchy

Expanded class hierarchy of OperatorsHelper

3 files declare their use of OperatorsHelper
ChannelManipulator.php in modules/entity_share_server/src/Service/ChannelManipulator.php
FilterAddForm.php in modules/entity_share_server/src/Form/FilterAddForm.php
FilterEditForm.php in modules/entity_share_server/src/Form/FilterEditForm.php

File

modules/entity_share_server/src/OperatorsHelper.php, line 10

Namespace

Drupal\entity_share_server
View source
class OperatorsHelper {

  /**
   * Helper function to get the operator options.
   *
   * @return array
   *   An array of options.
   */
  public static function getOperatorOptions() {
    return [
      '=' => '=',
      '<>' => '<>',
      '<' => '<',
      '<=' => '<=',
      '>' => '>',
      '>=' => '>=',
      'STARTS_WITH' => 'STARTS_WITH',
      'CONTAINS' => 'CONTAINS',
      'ENDS_WITH' => 'ENDS_WITH',
      'IN' => 'IN',
      'NOT IN' => 'NOT IN',
      'BETWEEN' => 'BETWEEN',
      'NOT BETWEEN' => 'NOT BETWEEN',
      'IS NULL' => 'IS NULL',
      'IS NOT NULL' => 'IS NOT NULL',
    ];
  }

  /**
   * Helper function to get the stand alone operators.
   *
   * Operators that do not require a value to be entered.
   *
   * @return array
   *   An array of options.
   */
  public static function getStandAloneOperators() {
    return [
      'IS NULL' => 'IS NULL',
      'IS NOT NULL' => 'IS NOT NULL',
    ];
  }

  /**
   * Helper function to get the multiple values operators.
   *
   * Operators that allow to have multiple values entered.
   *
   * @return array
   *   An array of options.
   */
  public static function getMultipleValuesOperators() {
    return [
      'IN' => 'IN',
      'NOT IN' => 'NOT IN',
      'BETWEEN' => 'BETWEEN',
      'NOT BETWEEN' => 'NOT BETWEEN',
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OperatorsHelper::getMultipleValuesOperators public static function Helper function to get the multiple values operators.
OperatorsHelper::getOperatorOptions public static function Helper function to get the operator options.
OperatorsHelper::getStandAloneOperators public static function Helper function to get the stand alone operators.