listeners[spl_object_hash($obj)] = $obj; return $this; } public function detach(SplObserver $obj) { unset($this->listeners[spl_object_hash($obj)]); return $this; } public function notify($message) { foreach ($this->listeners as $obj) { $obj->notify($message); } return $this; } }