public function __sleep() { // query whether we've a wrapped instance if ($wrapped = $this->getWrapped()) { $wrapped->getConnection()->close(); } // we want to serialize NOTHING return array(); }