protected function getListenerEvents(
        $listener,
        /*# string */ $eventName = ''
    )/*# : array */ {
        // check listener
        if (!$this->isListener($listener)) {
            throw new Exception\InvalidArgumentException(
                Message::get(
                    Message::INVALID_EVENT_LISTENER,
                    is_object($listener) ?
                        get_class($listener) :
                        $listener
                ),
                Message::INVALID_EVENT_LISTENER
            );
        }

        // get listener's listening event definition array
        if (is_object($listener)) {
            /* @var $listener EventListenerInterface */
            $evts = $listener->getEventsListening();
        } else {
            /* @var $listener EventListenerStaticInterface */
            $evts = $listener::getEventsListeningStatically();
        }

        if ($eventName != '') {
            foreach (array_keys($evts) as $name) {
                if ($name !== $eventName) {
                    unset($evts[$name]);
                }
            }
        }

        return $evts;
    }
protected function getListenerEvents(
        $listener,
        /*# string */ $eventName = ''
    )/*# : array */ {
        // check listener
        if (!$this->isListener($listener)) {
            throw new Exception\InvalidArgumentException(
                Message::get(
                    Message::INVALID_EVENT_LISTENER,
                    is_object($listener) ?
                        get_class($listener) :
                        $listener
                ),
                Message::INVALID_EVENT_LISTENER
            );
        }

        // get listener's listening event definition array
        if (is_object($listener)) {
            /* @var $listener EventListenerInterface */
            $evts = $listener->getEventsListening();
        } else {
            /* @var $listener EventListenerStaticInterface */
            $evts = $listener::getEventsListeningStatically();
        }

        if ($eventName != '') {
            foreach (array_keys($evts) as $name) {
                if ($name !== $eventName) {
                    unset($evts[$name]);
                }
            }
        }

        return $evts;
    }
protected function getListenerEvents ( $ listener , /*# string */ $ eventName = '' ) /*# : array */ { // check listener if ( ! $ this -> isListener ( $ listener ) ) { throw new Exception \ InvalidArgumentException ( Message :: get ( Message :: INVALID_EVENT_LISTENER , is_object ( $ listener ) ? get_class ( $ listener ) : $ listener ) , Message :: INVALID_EVENT_LISTENER ) ; } // get listener's listening event definition array if ( is_object ( $ listener ) ) { /* @var $listener EventListenerInterface */ $ evts = $ listener -> getEventsListening ( ) ; } else { /* @var $listener EventListenerStaticInterface */ $ evts = $ listener :: getEventsListeningStatically ( ) ; } if ( $ eventName != '' ) { foreach ( array_keys ( $ evts ) as $ name ) { if ( $ name !== $ eventName ) { unset ( $ evts [ $ name ] ) ; } } } return $ evts ; }
Get listener events array

@param  EventListenerInterface|string $listener object/static class name
@param  string $eventName event name or '' for all events
@return array
@throws Exception\InvalidArgumentException
if $listener not a valid listener
@access protected
Get listener events array