Changes for core/lib/Drupal/Core/Database/Query/Query.php: 10 added lines, 9 removed lines.
Original line number
Diff line number
Diff line
@@ -2,7 +2,6 @@
namespaceDrupal\Core\Database\Query;
useDrupal\Core\Database\Database;
useDrupal\Core\Database\Connection;
/**
@@ -81,19 +80,21 @@ public function __construct(Connection $connection, $options) {
}
/**
* Implements the magic __sleep function to disconnect from the database.
* Prevents serialization of query objects.
*
* @throws \LogicException
*/
publicfunction__sleep():array{
$keys=get_object_vars($this);
unset($keys['connection']);
returnarray_keys($keys);
publicfunction__serialize():array{
thrownew\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.');
}
/**
* Implements the magic __wakeup function to reconnect to the database.