You are here

public function Select::compiled in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Query/Select.php \Drupal\Core\Database\Query\Select::compiled()

Check whether a condition has been previously compiled.

Return value

TRUE if the condition has been previously 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 252

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;
}