Get the root form this element belongs to

@internal
@throws FormDefinitionConsistencyException
@return FormDefinition
764404
public function getRootForm()
    {
        $rootRenderable = $this->parentRenderable;
        while ($rootRenderable !== null && !($rootRenderable instanceof FormDefinition)) {
            $rootRenderable = $rootRenderable->getParentRenderable();
        }
        if ($rootRenderable === null) {
            throw new FormDefinitionConsistencyException(sprintf('The form element "%s" is not attached to a parent form.', $this->identifier), 1326803398);
        }

        return $rootRenderable;
    }
255663
public function getRootContext()
    {
        if ($parentContext = $this->getParentContext()) {
            if ($parentContext instanceof ParentDelegationBuilder) {
                return $parentContext->getRootContext();
            }
            return $parentContext;
        }

        return $this;
    }
811071
protected function proxy() {
        if (!$this->context) {
            $this->context = new FormContext($this->version, $this->solution['formType']);
        }

        return $this->context;
    }
192524
public Config getRoot()
  {
    Config root = this;
    while(root.parent != null) {
      root = root.parent;
    }
    return root;
  }
736756
public function getFromForm()
    {
        if ($this->form !== null) {
            $this->company_id = $this->form->company_id;
            $this->user_id = $this->form->user_id;
            $this->role = $this->form->role;
        }
    }
1165188
public static function root()
    {
        $url = request('REQUEST_URI', '', 'server');
        $root = request('DOCUMENT_ROOT', '', 'server');
        $scheme = request('REQUEST_SCHEME', '', 'server');
        $server = request('SERVER_NAME', '', 'server');

        $url = substr($url, 1);

        $parts = explode('/', $url);
        //
        $folder = '';
        //
        for ($i = 0; $i < count($parts); $i++) {
            if (File::isDirectory($root.$folder.$parts[$i].'/')) {
                $folder .= $parts[$i].'/';
            } else {
                break;
            }
        }

        return $scheme.'://'.$server.'/'.$folder;
    }
474439
public function root() : ContainerElement
    {
        // no need to check anything else, we are at the top
        if ($this instanceof Speak) {
            return $this;
        }

        // loop until we find an element that has no parent
        $currentParent = $this->parent;
        while ($currentParent->parent !== null) {
            $currentParent = $currentParent->parent;
        }

        return $currentParent;
    }
769056
public function getRoot()
    {
        if (!$this->root) {
            $this->root = $this->active->getContext()->getCurrentSiteNode();
        }

        return $this->root;
    }
424007
public function getForm()
    {
        $elementString = '';

        if (isset($this->attributes[self::$formHolder[self::$formName]])) {
            $elementString .= $this->attributes[self::$formHolder[self::$formName]][self::$formName];
        }

        $elementString .= $this->getHtmlElements();

        $close = null;
        $close = self::$formHolder[self::$formName].'_close';

        if (isset($this->attributes[$close])) {
            $elementString .= $this->attributes[$close];
        }

        return $this->element[self::$formHolder[self::$formName]] = $elementString;
    }
15719
public function getForm()
    {
        if (null === $this->form) {
            $this->setForm($this->getUserService()->getLoginForm());
        }

        return $this->form;
    }
99325
protected function getFormElementManager()
    {
        if (null === $this->formElementManager) {
            $this->formElementManager = $this->getServiceLocator()
                    ->get('FormElementManager');
        }
        return $this->formElementManager;
    }
947541
public @Nonnull Object getRoot() {
    Chain current = this;
    while (current.hasParent()) {
      current = current.getParent();
    }
    return current.getValue();
  }
372743
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);
        }
    }
259298
public function getRootId()
    {
        if (empty($this->hierarchy)) {
            throw new Exception\LogicException('The root item does not exist.');
        }

        reset($this->hierarchy);
        $id = key($this->hierarchy);

        return $id;
    }
574663
public java.lang.String getRootElement() {
        return (java.lang.String) getStateHelper().eval(PropertyKeys.rootElement);

    }
419851
protected function definition() {
        global $CFG;

        $mform = $this->_form;
        list($context, $capability, $overridableroles) = $this->_customdata;

        list($needed, $forbidden) = get_roles_with_cap_in_context($context, $capability->name);
        foreach ($needed as $id => $unused) {
            unset($overridableroles[$id]);
        }
        foreach ($forbidden as $id => $unused) {
            unset($overridableroles[$id]);
        }

        $mform->addElement('header', 'allowheader', get_string('roleallowheader', 'core_role'));

        $mform->addElement('select', 'roleid', get_string('roleselect', 'core_role'), $overridableroles);

        $mform->addElement('hidden', 'capability');
        $mform->setType('capability', PARAM_CAPABILITY);
        $mform->setDefault('capability', $capability->name);

        $mform->addElement('hidden', 'contextid');
        $mform->setType('contextid', PARAM_INT);
        $mform->setDefault('contextid', $context->id);

        $mform->addElement('hidden', 'allow');
        $mform->setType('allow', PARAM_INT);
        $mform->setDefault('allow', 1);

        $this->add_action_buttons(true, get_string('allow', 'core_role'));
    }
1000451
public function getRootNodeMenuItem()
    {
        if (is_null($this->rootNodeMenuItem)) {
            $rootNode = $this->domainConfiguration->getRootNode();
            if (!is_null($rootNode)) {
                $nodeTranslation = $rootNode->getNodeTranslation(
                    $this->locale,
                    $this->includeOffline
                );
                $this->rootNodeMenuItem = new NodeMenuItem(
                    $rootNode,
                    $nodeTranslation,
                    false,
                    $this
                );
            } else {
                $this->rootNodeMenuItem = $this->breadCrumb[0];
            }
        }

        return $this->rootNodeMenuItem;
    }