public function detachListener(EventListener $listener)
    {
        foreach ($listener->getEventHandlers() as $name => $method) {
            if (! is_string($name)) {
                $name = $method;
                if (strpos($method, '.') !== false) {
                    $splits = explode('.', $method);
                    $method = $splits[count($splits) - 1];
                }
            }
            $this->detachHandler($name, array(
                $listener,
                $method
            ));
        }
    }