Using a conditional OR in a view query alter programmatically I am trying to use an conditional OR in my custom module. 

hook_views_query_alter(Drupal\Core\Database\Query\AlterableInterface $query)


I get it to work with either one of these conditions set, but not together. 

if (isset($query-&gt;alterTags['VIENAME'])) {
  $query-&gt;condition('draggableviews_structure.entity_id' , NULL, 'IS NULL');
  $query-&gt;condition('draggableviews_structure.view_name', 'view_display_name', '=');
}


How do I set an OR value between them, so if either is true?

Thanks
You can do this by using orConditionGroup():

$query = \Drupal::entityQuery('map');
  $group = $query-&gt;orConditionGroup()
    -&gt;condition('attributes.color', 'red')
    -&gt;condition('attributes.color', 'green');
  $entity_ids = $query
    -&gt;condition('attributes.building_type', 'bikeshed')
    -&gt;condition($group)
    -&gt;execute();


Example from https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Query!QueryInterface.php/function/QueryInterface%3A%3AorConditionGroup/8.2.x