Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper::getValueAttribute PHP Method

getValueAttribute() protected method

Returns the current value of this Form ViewHelper and converts it to an identifier string in case it's an object The value is determined as follows: * If property mapping errors occurred and the form is re-displayed, the *last submitted* value is returned * Else the bound property is returned (only in objectAccessor-mode) * As fallback the "value" argument of this ViewHelper is used
protected getValueAttribute ( boolean $ignoreSubmittedFormData = false ) : mixed
$ignoreSubmittedFormData boolean By default the submitted form value has precedence over value/property argument upon re-display. With this flag set the submitted data is not evaluated (e.g. for checkbox and hidden fields where the value attribute should not be changed)
return mixed Value
    protected function getValueAttribute($ignoreSubmittedFormData = false)
    {
        $value = null;
        $submittedFormData = null;
        if (!$ignoreSubmittedFormData && $this->hasMappingErrorOccurred()) {
            $submittedFormData = $this->getLastSubmittedFormData();
        }
        if ($submittedFormData !== null) {
            $value = $submittedFormData;
        } elseif ($this->hasArgument('value')) {
            $value = $this->arguments['value'];
        } elseif ($this->isObjectAccessorMode()) {
            $value = $this->getPropertyValue();
        }
        if (is_object($value)) {
            $identifier = $this->persistenceManager->getIdentifierByObject($value);
            if ($identifier !== null) {
                $value = $identifier;
            }
        }
        return $value;
    }