public function handle(Event $event)
    {
        $name = $event->getName();
        list(, $method) = explode('.', $name);
        if (empty($this->_config['for']) && empty($this->_config['when'])) {
            return $this->{$method}($event);
        }
        if ($this->matches($event)) {
            return $this->{$method}($event);
        }
    }
public function handle(Event $event)
    {
        $name = $event->getName();
        list(, $method) = explode('.', $name);
        if (empty($this->_config['for']) && empty($this->_config['when'])) {
            return $this->{$method}($event);
        }
        if ($this->matches($event)) {
            return $this->{$method}($event);
        }
    }
public function handle ( Event $ event ) { $ name = $ event -> getName ( ) ; list ( , $ method ) = explode ( '.' , $ name ) ; if ( empty ( $ this -> _config [ 'for' ] ) && empty ( $ this -> _config [ 'when' ] ) ) { return $ this -> { $ method } ( $ event ) ; } if ( $ this -> matches ( $ event ) ) { return $ this -> { $ method } ( $ event ) ; } }
Handler method that applies conditions and resolves the correct method to call.

@param \Cake\Event\Event $event The event instance.
@return mixed
Handler method that applies conditions and resolves the correct method to call .