protected function retrieveFormBasedUrl($parameterName, BaseForm $form = null)
    {
        $url = null;

        if ($form != null) {
            $url = $form->getFormDefinedUrl($parameterName);
        } else {
            $url = $this->container->get('request_stack')->getCurrentRequest()->get($parameterName);
        }

        return $url;
    }