priority = $priority; $listeners = array(); $listeners[] = $events->attach('foo.bar', array( $this, 'fooBar' )); $listeners[] = $events->attach('foo.baz', array( $this, 'fooBaz' )); $this->listeners[ spl_object_hash($events) ] = $listeners; return __METHOD__; } public function detach(Zend_EventManager_EventCollection $events) { foreach ($this->listeners[ spl_object_hash($events) ] as $listener) { $events->detach($listener); } return __METHOD__; } public function fooBar() { return __METHOD__; } public function fooBaz() { return __METHOD__; } }