Documentation

FormDataCollector extends DataCollector
in package
implements FormDataCollectorInterface

Data collector for {@link FormInterface} instances.

Tags
author

Robert Schönthal robert.schoenthal@gmail.com

author

Bernhard Schussek bschussek@gmail.com

final

Table of Contents

Interfaces

FormDataCollectorInterface
Collects and structures information about forms.

Properties

$data  : array<string|int, mixed>|Data
$cloner  : mixed
$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.

Methods

__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()  : string
{@inheritdoc}
reset()  : mixed
cloneVar()  : Data
Converts the variable into a serializable Data instance.
getCasters()  : array<string|int, callable>
recursiveBuildFinalFormTree()  : mixed
recursiveBuildPreliminaryFormTree()  : mixed

Properties

$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.

$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

__sleep()

public __sleep() : array<string|int, mixed>
Return values
array<string|int, 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

collect()

Does nothing. The data is collected during the form event listeners.

public collect(Request $request, Response $response[, Throwable $exception = null ]) : mixed
Parameters
$request : Request
$response : Response
$exception : Throwable = null

collectViewVariables()

Stores the view variables of the given form view and its children.

public collectViewVariables(FormView $view) : mixed
Parameters
$view : FormView

getData()

Returns all collected data.

public getData() : array<string|int, mixed>|Data
Return values
array<string|int, mixed>|Data

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

recursiveBuildPreliminaryFormTree()

private & recursiveBuildPreliminaryFormTree(FormInterface $form, array<string|int, mixed> &$outputByHash) : mixed
Parameters
$form : FormInterface
$outputByHash : array<string|int, mixed>

        
On this page

Search results