[Form] optimized PropertyPathMapper to invoke the expensive property path less often
This commit is contained in:
parent
47a8bbdada
commit
492c99073b
@ -71,9 +71,7 @@ class PropertyPathMapper implements DataMapperInterface
|
|||||||
if (null !== $propertyPath && $config->getMapped() && $form->isSynchronized() && !$form->isDisabled()) {
|
if (null !== $propertyPath && $config->getMapped() && $form->isSynchronized() && !$form->isDisabled()) {
|
||||||
// If the data is identical to the value in $data, we are
|
// If the data is identical to the value in $data, we are
|
||||||
// dealing with a reference
|
// dealing with a reference
|
||||||
$isReference = $form->getData() === $propertyPath->getValue($data);
|
if (!is_object($data) || !$config->getByReference() || $form->getData() !== $propertyPath->getValue($data)) {
|
||||||
|
|
||||||
if (!is_object($data) || !$isReference || !$config->getByReference()) {
|
|
||||||
$propertyPath->setValue($data, $form->getData());
|
$propertyPath->setValue($data, $form->getData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user