private static function addEntityQueryCondition(QueryInterface &$query, $key, $value) {
    $simple = array(
      'from' => ['timestamp', '>='],
      'to' => ['timestamp', '<'],
    );

    if (isset($simple[$key])) {
      list($field, $op) = $simple[$key];
      $query->condition($field, $value, $op);
      return;
    }

    $query->condition($key, $value);
  }
private static function addEntityQueryCondition(QueryInterface &$query, $key, $value) {
    $simple = array(
      'from' => ['timestamp', '>='],
      'to' => ['timestamp', '<'],
    );

    if (isset($simple[$key])) {
      list($field, $op) = $simple[$key];
      $query->condition($field, $value, $op);
      return;
    }

    $query->condition($key, $value);
  }
private static function addEntityQueryCondition ( QueryInterface & $ query , $ key , $ value ) { $ simple = array ( 'from' => [ 'timestamp' , '>=' ] , 'to' => [ 'timestamp' , '<' ] , ) ; if ( isset ( $ simple [ $ key ] ) ) { list ( $ field , $ op ) = $ simple [ $ key ] ; $ query -> condition ( $ field , $ value , $ op ) ; return ; } $ query -> condition ( $ key , $ value ) ; }
Modifies entity query, by adding a condition.

@param \Drupal\Core\Entity\Query\QueryInterface $query
The entity query.
@param string $key
The condition key.
@param mixed $value
The condition value.
Modifies entity query by adding a condition .