protected function getValue($convertObjects = true)
{
$value = null;
if ($this->hasArgument('value')) {
$value = $this->arguments['value'];
} elseif ($this->isObjectAccessorMode()) {
if ($this->hasMappingErrorOccurred()) {
$value = $this->getLastSubmittedFormData();
} else {
$value = $this->getPropertyValue();
}
$this->addAdditionalIdentityPropertiesIfNeeded();
}
if ($convertObjects && is_object($value)) {
$identifier = $this->persistenceManager->getIdentifierByObject($value);
if ($identifier !== null) {
$value = $identifier;
}
}
return $value;
}