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) |
리턴 | 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;
}