PreSetDataEvent
extends FormEvent
in package
This event is dispatched at the beginning of the Form::setData() method.
It can be used to:
- Modify the data given during pre-population;
- Modify a form depending on the pre-populated data (adding or removing fields dynamically).
Tags
Table of Contents
- $data : mixed
- $form : mixed
- $propagationStopped : mixed
- __construct() : mixed
- getData() : mixed
- Returns the data associated with this event.
- getForm() : FormInterface
- Returns the form at the source of the event.
- isPropagationStopped() : bool
- setData() : mixed
- Allows updating with some filtered data.
- stopPropagation() : mixed
Properties
$data
protected
mixed
$data
$form
private
mixed
$form
$propagationStopped
private
mixed
$propagationStopped
= false
Methods
__construct()
public
__construct(FormInterface $form, mixed $data) : mixed
Parameters
- $form : FormInterface
- $data : mixed
-
The data
Return values
mixed —getData()
Returns the data associated with this event.
public
getData() : mixed
Return values
mixed —getForm()
Returns the form at the source of the event.
public
getForm() : FormInterface
Return values
FormInterface —isPropagationStopped()
public
isPropagationStopped() : bool
Tags
Return values
bool —Whether propagation was already stopped for this event
setData()
Allows updating with some filtered data.
public
setData(mixed $data) : mixed
Parameters
- $data : mixed
Return values
mixed —stopPropagation()
public
stopPropagation() : mixed