Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Query.php

function Query::__toString

Same name in this branch
  1. 11.1.x core/lib/Drupal/Core/Entity/Query/Sql/Query.php \Drupal\Core\Entity\Query\Sql\Query::__toString()

Implements PHP magic __toString method to convert the query to a string.

The toString operation is how we compile a query object to a prepared statement.

Return value

string A prepared statement query string for this object.

Throws

\BadMethodCallException Thrown when the operation is a Merge or the operation is not implemented, as in test.

9 methods override Query::__toString()
Delete::__toString in core/lib/Drupal/Core/Database/Query/Delete.php
Implements PHP magic __toString method to convert the query to a string.
Insert::__toString in core/lib/Drupal/Core/Database/Query/Insert.php
Implements PHP magic __toString method to convert the query to a string.
Merge::__toString in core/lib/Drupal/Core/Database/Query/Merge.php
Implements PHP magic __toString method to convert the query to a string.
Select::__toString in core/lib/Drupal/Core/Database/Query/Select.php
Implements PHP magic __toString method to convert the query to a string.
Truncate::__toString in core/lib/Drupal/Core/Database/Query/Truncate.php
Implements PHP magic __toString method to convert the query to a string.

... See full list

File

core/lib/Drupal/Core/Database/Query/Query.php, line 127

Class

Query
Base class for query builders.

Namespace

Drupal\Core\Database\Query

Code

public abstract function __toString();

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal