/** * Implements magic method __wakeup() * Recovers cached manager and class map */ public function __wakeup() { // recover manager when waking up $this->ep_m = epManager::instance(); // recover class map $this->ep_cm = $this->ep_m->getMap(get_class($this->ep_object)); // cache this object in manager (important for flush) $this->ep_m->cache($this, true); // true: force replace }