/** * Trying to re-retrieve the pdo connection after waking up */ public function __wakeup() { if ($this->name) { $this->connection = ConnectionContainer::getConnection($this->name); } }
/** * Class constructor. * * @param \PDO $connection The PDO connection object to help us escape string. * * @since 2.0 */ public function __construct(\PDO &$connection = null) { ($this->connection =& $connection) ?: ConnectionContainer::getConnection($this->name); }