public function __construct(PropertyAccessorInterface
$propertyAccessor = null
) { $this->propertyAccessor =
$propertyAccessor ?? PropertyAccess::
createPropertyAccessor();
} public function getValue(object|array
$data, FormInterface
$form): mixed
{ if (null ===
$propertyPath =
$form->
getPropertyPath()) { throw new AccessException('Unable to read from the given form data as no property path is defined.'
);
} return $this->
getPropertyValue($data,
$propertyPath);
} public function setValue(object|array &
$data, mixed
$value, FormInterface
$form): void
{ if (null ===
$propertyPath =
$form->
getPropertyPath()) { throw new AccessException('Unable to write the given value as no property path is defined.'
);
} // If the field is of type DateTimeInterface and the data is the same skip the update to
// keep the original object hash
if ($value instanceof \DateTimeInterface &&
$value ==
$this->
getPropertyValue($data,
$propertyPath)) {