public function getResult($paginatorAlias = null, $formAlias = null)
    {
        if (null === $paginatorAlias) {
            $paginatorAlias = isset($this->stack['paginator']['as'])
                            ? $this->stack['paginator']['as']
                            : 'paginator';
        }

        if (null === $formAlias) {
            $formAlias = isset($this->stack['form']['as']) ? $this->stack['form']['as'] : 'searchform';
        }

        /* @var \Zend\Mvc\Controller\AbstractController $controller
         * @var \Zend\Http\Request $request */
        $result = [];
        $controller = $this->getController();
        $request = $controller->getRequest();

        $this->setParameters($request->getQuery());

        if (isset($this->stack['params'])) {
            $this->callPlugin('paginationParams', $this->stack['params']);
        }

        if (isset($this->stack['form'])) {
            $form = $this->callPlugin('searchform', $this->stack['form']);
            if (!$request->isXmlHttpRequest()) {
                $result[$formAlias] = $form;
            }
        }

        if (isset($this->stack['paginator'])) {
            $result[$paginatorAlias] = $this->callPlugin('paginator', $this->stack['paginator']);
        }

        return $result;
    }