W3cubDocs

/Drupal 8

public function Connection::__sleep

public Connection::__sleep()

Prevents the database connection from being serialized.

File

core/lib/Drupal/Core/Database/Connection.php, line 1424

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function __sleep() {
  throw new \LogicException('The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution.');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Connection.php/function/Connection::__sleep/8.1.x