protected function attachIt(
        /*# string */ $eventName,
        $listener,
        $callable,
        /*# int */ $priority
    ) {
        // get named event queue
        if ($this->hasEventQueue($eventName)) {
            $q = $this->getEventQueue($eventName);
        } else {
            $q = new EventQueue();
            $this->events[$eventName] = $q;
        }

        // attach callable directory
        if (is_null($listener)) {
            // need $eventName
            if (empty($eventName)) {
                throw new Exception\InvalidArgumentException(
                    Message::get(Message::INVALID_EVENT_NAME, 'EMPTY'),
                    Message::INVALID_EVENT_NAME
                );
            }
            $xc = [
                [ $callable, (int) $priority ]
            ];
        // get callables from listener object or static listener class
        } else {
            $xc = $this->makeCallables($listener, $callable, (int) $priority);
        }

        if (empty($xc)) {
            throw new Exception\InvalidArgumentException(
                Message::get(Message::INVALID_EVENT_CALLABLE, $eventName),
                Message::INVALID_EVENT_CALLABLE
            );
        } else {
            foreach ($xc as $c) {
                $q->insert($c[0], $c[1]);
            }
        }
    }
protected function attachIt(
        /*# string */ $eventName,
        $listener,
        $callable,
        /*# int */ $priority
    ) {
        // get named event queue
        if ($this->hasEventQueue($eventName)) {
            $q = $this->getEventQueue($eventName);
        } else {
            $q = new EventQueue();
            $this->events[$eventName] = $q;
        }

        // attach callable directory
        if (is_null($listener)) {
            // need $eventName
            if (empty($eventName)) {
                throw new Exception\InvalidArgumentException(
                    Message::get(Message::INVALID_EVENT_NAME, 'EMPTY'),
                    Message::INVALID_EVENT_NAME
                );
            }
            $xc = [
                [ $callable, (int) $priority ]
            ];
        // get callables from listener object or static listener class
        } else {
            $xc = $this->makeCallables($listener, $callable, (int) $priority);
        }

        if (empty($xc)) {
            throw new Exception\InvalidArgumentException(
                Message::get(Message::INVALID_EVENT_CALLABLE, $eventName),
                Message::INVALID_EVENT_CALLABLE
            );
        } else {
            foreach ($xc as $c) {
                $q->insert($c[0], $c[1]);
            }
        }
    }
protected function attachIt ( /*# string */ $ eventName , $ listener , $ callable , /*# int */ $ priority ) { // get named event queue if ( $ this -> hasEventQueue ( $ eventName ) ) { $ q = $ this -> getEventQueue ( $ eventName ) ; } else { $ q = new EventQueue ( ) ; $ this -> events [ $ eventName ] = $ q ; } // attach callable directory if ( is_null ( $ listener ) ) { // need $eventName if ( empty ( $ eventName ) ) { throw new Exception \ InvalidArgumentException ( Message :: get ( Message :: INVALID_EVENT_NAME , 'EMPTY' ) , Message :: INVALID_EVENT_NAME ) ; } $ xc = [ [ $ callable , ( int ) $ priority ] ] ; // get callables from listener object or static listener class } else { $ xc = $ this -> makeCallables ( $ listener , $ callable , ( int ) $ priority ) ; } if ( empty ( $ xc ) ) { throw new Exception \ InvalidArgumentException ( Message :: get ( Message :: INVALID_EVENT_CALLABLE , $ eventName ) , Message :: INVALID_EVENT_CALLABLE ) ; } else { foreach ( $ xc as $ c ) { $ q -> insert ( $ c [ 0 ] , $ c [ 1 ] ) ; } } }
Attach callable to event queque

@param  string $eventName event name
@param  EventListenerInterface|string|null $listener
object/static class name or a callable
@param  mixed $callable string | array
@param  int $priority priority integer
@return void
@throws Exception\InvalidArgumentException
if callable is the wrong format
@access protected
Attach callable to event queque