src/Controller/ManageController.php
public function preDispatch(MvcEvent $e)
    {
        if ('calculate' == $this->params()->fromQuery('do')) {
            return;
        }
        $routeMatch = $e->getRouteMatch();
        $action = $routeMatch->getParam('action');
	    $services = $e->getApplication()->getServiceManager();
        if (in_array($action, array('edit', 'approval', 'completion'))) {
            $jobEvents = $services->get('Jobs/Events');
            $mailSender = $services->get('Jobs/Listener/MailSender');

            $mailSender->attach($jobEvents);
        }
    }
public function preDispatch(MvcEvent $e)
    {
        if ('calculate' == $this->params()->fromQuery('do')) {
            return;
        }
        $routeMatch = $e->getRouteMatch();
        $action = $routeMatch->getParam('action');
	    $services = $e->getApplication()->getServiceManager();
        if (in_array($action, array('edit', 'approval', 'completion'))) {
            $jobEvents = $services->get('Jobs/Events');
            $mailSender = $services->get('Jobs/Listener/MailSender');

            $mailSender->attach($jobEvents);
        }
    }
public function preDispatch ( MvcEvent $ e ) { if ( 'calculate' == $ this -> params ( ) -> fromQuery ( 'do' ) ) { return ; } $ routeMatch = $ e -> getRouteMatch ( ) ; $ action = $ routeMatch -> getParam ( 'action' ) ; $ services = $ e -> getApplication ( ) -> getServiceManager ( ) ; if ( in_array ( $ action , array ( 'edit' , 'approval' , 'completion' ) ) ) { $ jobEvents = $ services -> get ( 'Jobs/Events' ) ; $ mailSender = $ services -> get ( 'Jobs/Listener/MailSender' ) ; $ mailSender -> attach ( $ jobEvents ) ; } }
Dispatch listener callback.

Attaches the MailSender aggregate listener to the job event manager.

@param MvcEvent $e
@since 0.19
Dispatch listener callback .