1.20.x select.inc public SelectQuery::arguments()

Implements QueryConditionInterface::arguments().

Overrides QueryConditionInterface::arguments

File

includes/database/select.inc, line 1071

Class

SelectQuery
Query builder for SELECT statements.

Code

public function arguments() {
  if (!$this->compiled()) {
    return NULL;
  }

  $args = $this->where->arguments() + $this->having->arguments();

  foreach ($this->tables as $table) {
    if ($table['arguments']) {
      $args += $table['arguments'];
    }
    // If this table is a subquery, grab its arguments recursively.
    if ($table['table'] instanceof SelectQueryInterface) {
      $args += $table['table']->arguments();
    }
  }

  foreach ($this->expressions as $expression) {
    if ($expression['arguments']) {
      $args += $expression['arguments'];
    }
  }

  // If there are any dependent queries to UNION,
  // incorporate their arguments recursively.
  foreach ($this->union as $union) {
    $args += $union['query']->arguments();
  }

  return $args;
}