use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Database\Database;
+use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Plugin\views\display\DisplayPluginBase;
/**
* The default operator to use when connecting the WHERE groups. May be
* AND or OR.
+ *
+ * @var string
*/
protected $groupOperator = 'AND';
/**
* A flag as to whether or not to make the primary field distinct.
+ *
+ * @var bool
*/
public $distinct = FALSE;
+ /**
+ * @var bool
+ */
protected $hasAggregate = FALSE;
/**
* @code
* $this->query->addWhere(
* $this->options['group'],
- * db_or()
+ * (new Condition('OR'))
* ->condition($field, $value, 'NOT IN')
* ->condition($field, $value, 'IS NULL')
* );
$has_arguments = FALSE;
$has_filter = FALSE;
- $main_group = db_and();
- $filter_group = $this->groupOperator == 'OR' ? db_or() : db_and();
+ $main_group = new Condition('AND');
+ $filter_group = $this->groupOperator == 'OR' ? new Condition('OR') : new Condition('AND');
foreach ($this->$where as $group => $info) {
if (!empty($info['conditions'])) {
- $sub_group = $info['type'] == 'OR' ? db_or() : db_and();
+ $sub_group = $info['type'] == 'OR' ? new Condition('OR') : new Condition('AND');
foreach ($info['conditions'] as $clause) {
if ($clause['operator'] == 'formula') {
$has_condition = TRUE;
// Setup the result row objects.
$view->result = iterator_to_array($result);
- array_walk($view->result, function(ResultRow $row, $index) {
+ array_walk($view->result, function (ResultRow $row, $index) {
$row->index = $index;
});