protected function _callListenersWithCallback($listeners, array $arguments, $continueCallback)
    {
        $counter   = count($listeners);
        $execCount = 0;

        foreach ($listeners as $listener) {
            $counter--;

            if ($result = $this->_callListener($listener, $arguments)) {
                return $result;
            }
            $execCount++;

            if ($counter > 0 && false === $continueCallback()) {
                break;
            }
        }

        return $execCount;
    }
protected function _callListenersWithCallback($listeners, array $arguments, $continueCallback)
    {
        $counter   = count($listeners);
        $execCount = 0;

        foreach ($listeners as $listener) {
            $counter--;

            if ($result = $this->_callListener($listener, $arguments)) {
                return $result;
            }
            $execCount++;

            if ($counter > 0 && false === $continueCallback()) {
                break;
            }
        }

        return $execCount;
    }
protected function _callListenersWithCallback ( $ listeners , array $ arguments , $ continueCallback ) { $ counter = count ( $ listeners ) ; $ execCount = 0 ; foreach ( $ listeners as $ listener ) { $ counter -- ; if ( $ result = $ this -> _callListener ( $ listener , $ arguments ) ) { return $ result ; } $ execCount ++ ; if ( $ counter > 0 && false === $ continueCallback ( ) ) { break ; } } return $ execCount ; }
Call list of listeners with continue callback function

@param array    $listeners
@param array    $arguments
@param callable $continueCallback
@return int|string
Call list of listeners with continue callback function