diff --git a/core/lib/Drupal/Core/Database/Query/SelectExtender.php b/core/lib/Drupal/Core/Database/Query/SelectExtender.php index cca68c7287f..0c253de704e 100644 --- a/core/lib/Drupal/Core/Database/Query/SelectExtender.php +++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php @@ -338,6 +338,9 @@ class SelectExtender implements SelectInterface { return $this; } + /** + * {@inheritdoc} + */ public function __toString() { return (string) $this->query; } diff --git a/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/core/lib/Drupal/Core/Database/Query/SelectInterface.php index cd4950504b7..795c0860bce 100644 --- a/core/lib/Drupal/Core/Database/Query/SelectInterface.php +++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php @@ -648,4 +648,12 @@ interface SelectInterface extends ConditionInterface, AlterableInterface, Extend */ public function forUpdate($set = TRUE); + /** + * Returns a string representation of how the query will be executed in SQL. + * + * @return string + * The Select Query object expressed as a string. + */ + public function __toString(); + }