You are here

public function Connection::unserialize in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::unserialize()

File

lib/Drupal/Core/Database/Connection.php, line 219
Contains \Drupal\Core\Database\Connection.

Class

Connection

Namespace

Drupal\Core\Database

Code

public function unserialize($serialized) {
  throw new \Exception('unserialize is not implemented yet.');
  $data = unserialize($serialized);
  foreach ($data as $key => $value) {
    $this->{$key} = $value;
  }

  // Re-establish the PDO connection using the original options.
  $this->connection = static::open($this->connectionOptions);

  // Re-set a Statement class if necessary.
  if (!empty($this->statementClass)) {
    $this->connection
      ->setAttribute(\PDO::ATTR_STATEMENT_CLASS, array(
      $this->statementClass,
      array(
        $this,
      ),
    ));
  }
}