1.20.x select.inc public SelectQuery::union(SelectQueryInterface $query, $type = '')

Implements SelectQueryInterface::union().

return SelectQuery

Overrides SelectQueryInterface::union

File

includes/database/select.inc, line 1626

Class

SelectQuery
Query builder for SELECT statements.

Code

public function union(SelectQueryInterface $query, $type = '') {
  // Handle UNION aliasing.
  switch ($type) {
    // Fold UNION DISTINCT to UNION for better cross database support.
    case 'DISTINCT':
    case '':
      $type = 'UNION';
      break;

    case 'ALL':
      $type = 'UNION ALL';
    default:
  }

  $this->union[] = array(
    'type' => $type,
    'query' => $query,
  );

  return $this;
}