Beispiel #1
0
 /**
  * When unserializing an object, this will re-attach any event handlers...
  */
 public function __wakeup()
 {
     //	This is my hash. There are many like it, but this one is mine.
     $this->_id = hash('sha256', spl_object_hash($this) . getmypid() . microtime(true));
     //	Auto-set tag and name if empty
     $this->_tag = $this->_tag ?: Inflector::neutralize(get_called_class());
     $this->_name = $this->_name ?: $this->_tag;
     if ($this instanceof SubscriberLike) {
         EventManager::discoverListeners($this);
     }
     //	Publish after_construct event
     if ($this->_enableLifeEvents) {
         $this->trigger(LifeEvents::AFTER_CONSTRUCT);
     }
 }