public function setContainer(ContainerInterface $container = NULL)
    {
        parent::setContainer($container);

        if(!$this->container->getParameter('fom_user.selfregister'))
            throw new AccessDeniedHttpException();
    }
public function setContainer(ContainerInterface $container = NULL)
    {
        parent::setContainer($container);

        if(!$this->container->getParameter('fom_user.selfregister'))
            throw new AccessDeniedHttpException();
    }
public function setContainer ( ContainerInterface $ container = NULL ) { parent :: setContainer ( $ container ) ; if ( ! $ this -> container -> getParameter ( 'fom_user.selfregister' ) ) throw new AccessDeniedHttpException ( ) ; }
Check if self registration is allowed.

setContainer is called after controller creation is used to deny access to controller if self registration has
been disabled.
Check if self registration is allowed .