function SelectQuery::arguments

Overrides QueryConditionInterface::arguments

1 call to SelectQuery::arguments()
SelectQuery::getArguments in includes/database/
Compiles and returns an associative array of the arguments for this prepared statement.


includes/database/, line 1034


Query builder for SELECT statements.


public function arguments() {
    if (!$this->compiled()) {
        return NULL;
    $args = $this->where
        ->arguments() + $this->having
    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();
        // If the join condition is an object, grab its arguments recursively.
        if (!empty($table['condition']) && $table['condition'] instanceof QueryConditionInterface) {
            $args += $table['condition']->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;

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.