/** * Restore variables when the address is unserialized. * * @access public * @return void */ public function __wakeup() { parent::__wakeup(); $this->addressBook = UcAddressesAddressBook::get($this->getSchemaAddress()->uid); if ($this->getId() <= self::$nextNewAid) { self::$nextNewAid = $this->getId() - 1; } try { $this->addressBook->addAddress($this); } catch (UcAddressesException $e) { // Ignore any exceptions. } }