function Select::compiled

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::compiled()
  2. 8.9.x core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::compiled()
  3. 11.x core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::compiled()

Overrides QueryConditionTrait::compiled

2 calls to Select::compiled()
Select::arguments in core/lib/Drupal/Core/Database/Query/Select.php
Gets a complete list of all values to insert into the prepared statement.
Select::__toString in core/lib/Drupal/Core/Database/Query/Select.php
Implements PHP magic __toString method to convert the query to a string.

File

core/lib/Drupal/Core/Database/Query/Select.php, line 265

Class

Select
Query builder for SELECT statements.

Namespace

Drupal\Core\Database\Query

Code

public function compiled() {
  if (!$this->condition
    ->compiled() || !$this->having
    ->compiled()) {
    return FALSE;
  }
  foreach ($this->tables as $table) {
    // If this table is a subquery, check its status recursively.
    if ($table['table'] instanceof SelectInterface) {
      if (!$table['table']->compiled()) {
        return FALSE;
      }
    }
    if (!empty($table['condition']) && $table['condition'] instanceof ConditionInterface) {
      if (!$table['condition']->compiled()) {
        return FALSE;
      }
    }
  }
  foreach ($this->union as $union) {
    if (!$union['query']->compiled()) {
      return FALSE;
    }
  }
  return TRUE;
}

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