public function get($form, $options = null, $params = null)
    {
        if (!is_object($form)) {
            $form             = $this->formElementManager->get($form, $options);
        }

        /** @noinspection PhpUndefinedMethodInspection */
        $params           = $params ?: clone $this->getController()->getRequest()->getQuery();

        /* I tried using form methods (bind, isValid)...
         * but because the search form could be in an invalidated state
         * when the page is loaded, we need to hydrate the params manually.
         */
        $hydrator = $form->getHydrator();
        $data     = $hydrator->extract($params);
        $form->setData($data);

        $hydrator->hydrate($data, $params);

        return $form;
    }