CodeExplorer setErrorBubbling example
protected function getForm($name = 'name',
$propertyPath = null,
$dataClass = null,
$errorMapping =
[],
$inheritData = false,
$synchronized = true, array
$options =
[]) { $config =
new FormConfigBuilder($name,
$dataClass,
$this->dispatcher,
[ 'error_mapping' =>
$errorMapping,
] +
$options);
$config->
setMapped($options['mapped'
] ?? true
);
$config->
setInheritData($inheritData);
$config->
setPropertyPath($propertyPath);
$config->
setCompound(true
);
$config->
setDataMapper(new DataMapper());
$config->
setErrorBubbling($options['error_bubbling'
] ?? false
);
if (!
$synchronized) { $config->
addViewTransformer(new CallbackTransformer( static fn ($normData) =>
$normData,
static fn () =>
throw new TransformationFailedException() ));
} return new Form($config);
}