FormDataCollector
extends DataCollector
in package
implements
FormDataCollectorInterface
Data collector for {@link FormInterface} instances.
Tags
Interfaces, Classes, Traits and Enums
- FormDataCollectorInterface
- Collects and structures information about forms.
Table of Contents
- $data : array<string|int, mixed>|Data
- $cloner : ClonerInterface
- $dataByForm : array<string|int, mixed>
- Stores the collected data per {@link FormInterface} instance.
- $dataByView : array<string|int, mixed>
- Stores the collected data per {@link FormView} instance.
- $dataExtractor : mixed
- $formsByView : array<string|int, mixed>
- Connects {@link FormView} with {@link FormInterface} instances.
- __construct() : mixed
- __sleep() : array<string|int, mixed>
- __wakeup() : mixed
- associateFormWithView() : mixed
- Specifies that the given objects represent the same conceptual form.
- buildFinalFormTree() : mixed
- Assembles the data collected about the given form and its children as a tree-like data structure.
- buildPreliminaryFormTree() : mixed
- Assembles the data collected about the given form and its children as a tree-like data structure.
- collect() : mixed
- Does nothing. The data is collected during the form event listeners.
- collectConfiguration() : mixed
- Stores configuration data of the given form and its children.
- collectDefaultData() : mixed
- Stores the default data of the given form and its children.
- collectSubmittedData() : mixed
- Stores the submitted data of the given form and its children.
- collectViewVariables() : mixed
- Stores the view variables of the given form view and its children.
- getData() : array<string|int, mixed>|Data
- Returns all collected data.
- getName() : mixed
- {@inheritdoc}
- reset() : mixed
- serialize() : mixed
- unserialize() : mixed
- cloneVar() : Data
- Converts the variable into a serializable Data instance.
- getCasters() : array<string|int, callable>
- recursiveBuildFinalFormTree() : mixed
- recursiveBuildPreliminaryFormTree() : mixed
Properties
$data
protected
array<string|int, mixed>|Data
$data
= []
$cloner
private
ClonerInterface
$cloner
$dataByForm
Stores the collected data per {@link FormInterface} instance.
private
array<string|int, mixed>
$dataByForm
Uses the hashes of the forms as keys. This is preferable over using , because in this way no references are kept to the instances.
$dataByView
Stores the collected data per {@link FormView} instance.
private
array<string|int, mixed>
$dataByView
Uses the hashes of the views as keys. This is preferable over using , because in this way no references are kept to the instances.
$dataExtractor
private
mixed
$dataExtractor
$formsByView
Connects {@link FormView} with {@link FormInterface} instances.
private
array<string|int, mixed>
$formsByView
Uses the hashes of the views as keys and the hashes of the forms as values. This is preferable over storing the objects directly, because this way they can safely be discarded by the GC.
Methods
__construct()
public
__construct(FormDataExtractorInterface $dataExtractor) : mixed
Parameters
- $dataExtractor : FormDataExtractorInterface
Return values
mixed —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__wakeup()
public
__wakeup() : mixed
Return values
mixed —associateFormWithView()
Specifies that the given objects represent the same conceptual form.
public
associateFormWithView(FormInterface $form, FormView $view) : mixed
Parameters
- $form : FormInterface
- $view : FormView
Return values
mixed —buildFinalFormTree()
Assembles the data collected about the given form and its children as a tree-like data structure.
public
buildFinalFormTree(FormInterface $form, FormView $view) : mixed
Parameters
- $form : FormInterface
- $view : FormView
Return values
mixed —buildPreliminaryFormTree()
Assembles the data collected about the given form and its children as a tree-like data structure.
public
buildPreliminaryFormTree(FormInterface $form) : mixed
Parameters
- $form : FormInterface
Return values
mixed —collect()
Does nothing. The data is collected during the form event listeners.
public
collect(Request $request, Response $response) : mixed
Parameters
- $request : Request
- $response : Response
Return values
mixed —collectConfiguration()
Stores configuration data of the given form and its children.
public
collectConfiguration(FormInterface $form) : mixed
Parameters
- $form : FormInterface
Return values
mixed —collectDefaultData()
Stores the default data of the given form and its children.
public
collectDefaultData(FormInterface $form) : mixed
Parameters
- $form : FormInterface
Return values
mixed —collectSubmittedData()
Stores the submitted data of the given form and its children.
public
collectSubmittedData(FormInterface $form) : mixed
Parameters
- $form : FormInterface
Return values
mixed —collectViewVariables()
Stores the view variables of the given form view and its children.
public
collectViewVariables(FormView $view) : mixed
Parameters
- $view : FormView
Return values
mixed —getData()
Returns all collected data.
public
getData() : array<string|int, mixed>|Data
Return values
array<string|int, mixed>|Data —getName()
{@inheritdoc}
public
getName() : mixed
Return values
mixed —reset()
public
reset() : mixed
Return values
mixed —serialize()
public
serialize() : mixed
Tags
Return values
mixed —unserialize()
public
unserialize(mixed $data) : mixed
Parameters
- $data : mixed
Tags
Return values
mixed —cloneVar()
Converts the variable into a serializable Data instance.
protected
cloneVar(mixed $var) : Data
This array can be displayed in the template using the VarDumper component.
Parameters
- $var : mixed
Return values
Data —getCasters()
protected
getCasters() : array<string|int, callable>
Return values
array<string|int, callable> —The casters to add to the cloner
recursiveBuildFinalFormTree()
private
recursiveBuildFinalFormTree([FormInterface $form = null ], FormView $view, array<string|int, mixed> &$outputByHash) : mixed
Parameters
- $form : FormInterface = null
- $view : FormView
- $outputByHash : array<string|int, mixed>
Return values
mixed —recursiveBuildPreliminaryFormTree()
private
recursiveBuildPreliminaryFormTree(FormInterface $form, array<string|int, mixed> &$outputByHash) : mixed
Parameters
- $form : FormInterface
- $outputByHash : array<string|int, mixed>