protected function getFormParent()
    {
        // If polymorphic relationship is actually defined, use it
        if ($this->FormID && $this->FormClass) {
            $formClass = $this->FormClass;
            return $formClass::get()->byID($this->FormID);
        }

        // Revert to checking for a form from the session
        // LeftAndMain::sessionNamespace is protected. @todo replace this with a non-deprecated equivalent.
        $sessionNamespace = $this->config()->get('session_namespace') ?: CMSMain::class;

        $formID = Controller::curr()->getRequest()->getSession()->get($sessionNamespace . '.currentPage');
        if ($formID) {
            return UserDefinedForm::get()->byID($formID);
        }
    }
protected function getFormParent()
    {
        // If polymorphic relationship is actually defined, use it
        if ($this->FormID && $this->FormClass) {
            $formClass = $this->FormClass;
            return $formClass::get()->byID($this->FormID);
        }

        // Revert to checking for a form from the session
        // LeftAndMain::sessionNamespace is protected. @todo replace this with a non-deprecated equivalent.
        $sessionNamespace = $this->config()->get('session_namespace') ?: CMSMain::class;

        $formID = Controller::curr()->getRequest()->getSession()->get($sessionNamespace . '.currentPage');
        if ($formID) {
            return UserDefinedForm::get()->byID($formID);
        }
    }
protected function getFormParent ( ) { // If polymorphic relationship is actually defined, use it if ( $ this -> FormID && $ this -> FormClass ) { $ formClass = $ this -> FormClass ; return $ formClass :: get ( ) -> byID ( $ this -> FormID ) ; } // Revert to checking for a form from the session // LeftAndMain::sessionNamespace is protected. @todo replace this with a non-deprecated equivalent. $ sessionNamespace = $ this -> config ( ) -> get ( 'session_namespace' ) ? : CMSMain :: class ; $ formID = Controller :: curr ( ) -> getRequest ( ) -> getSession ( ) -> get ( $ sessionNamespace . '.currentPage' ) ; if ( $ formID ) { return UserDefinedForm :: get ( ) -> byID ( $ formID ) ; } }
Get instance of UserForm when editing in getCMSFields

@return UserDefinedForm|UserForm|null
Get instance of UserForm when editing in getCMSFields