You are here

public function ActivityPlugin::addWhereExpression in Activity 8

File

src/Plugin/views/query/ActivityPlugin.php, line 135

Class

ActivityPlugin
Activity views query plugin which display all activities.

Namespace

Drupal\activity\Plugin\views\query

Code

public function addWhereExpression($group, $snippet, $args = []) {

  // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
  // the default group.
  if (empty($group)) {
    $group = 0;
  }

  // Check for a group.
  if (!isset($this->where[$group])) {
    $this
      ->setWhereGroup('AND', $group);
  }
  $this->where[$group]['conditions'][] = [
    'field' => $snippet,
    'value' => $args,
    'operator' => 'formula',
  ];
  if ($this->activities instanceof Select) {
    $this->activities
      ->where($snippet, []);
  }
}