function Query::__serialize

Prevents serialization of query objects.

Throws

\LogicException

File

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

Class

Query
Base class for query builders.

Namespace

Drupal\Core\Database\Query

Code

public function __serialize() : array {
  throw new \LogicException('Database query objects are not serializable. This probably means you are serializing an object that has a reference to a query object. Adjust your code so that is not necessary, for example by storing the query arguments or results instead.');
}

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