class ButtonBuilder implements IteratorAggregate, FormBuilderInterface

A builder for {@link Button} instances.

Methods

__construct(string $name, array $options = array())

Creates a new button builder.

add(string|int|FormBuilderInterface $child, string|FormTypeInterface $type = null, array $options = array())

Unsupported method.

create(string $name, string|FormTypeInterface $type = null, array $options = array())

Unsupported method.

get(string $name)

Unsupported method.

remove(string $name)

Unsupported method.

bool
has(string $name)

Unsupported method.

array
all()

Returns the children.

getForm()

Creates the button.

addEventListener(string $eventName, callable $listener, int $priority)

Unsupported method.

addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false)

Unsupported method.

addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false)

Unsupported method.

setAttribute(string $name, mixed $value)

Sets the value for an attribute.

setAttributes(array $attributes)

Sets the attributes.

setDataMapper(DataMapperInterface $dataMapper = null)

Unsupported method.

setDisabled(bool $disabled)

Set whether the button is disabled.

setEmptyData(mixed $emptyData)

Unsupported method.

setErrorBubbling(bool $errorBubbling)

Unsupported method.

setRequired(bool $required)

Unsupported method.

setPropertyPath(null|string|PropertyPathInterface $propertyPath)

Unsupported method.

setMapped(bool $mapped)

Unsupported method.

setByReference(bool $byReference)

Unsupported method.

setCompound(bool $compound)

Unsupported method.

setType(ResolvedFormTypeInterface $type)

Sets the type of the button.

setData(mixed $data)

Unsupported method.

setDataLocked(bool $locked)

Unsupported method.

setFormFactory(FormFactoryInterface $formFactory)

Unsupported method.

setAction(string $action)

Unsupported method.

setMethod(string $method)

Unsupported method.

setAutoInitialize(bool $initialize)

Unsupported method.

setInheritData(bool $inheritData)

Unsupported method.

getFormConfig()

Builds and returns the button configuration.

string
getName()

Returns the name of the form used as HTTP parameter.

getPropertyPath()

Unsupported method.

bool
getMapped()

Unsupported method.

bool
getByReference()

Unsupported method.

bool
getCompound()

Unsupported method.

getType()

Returns the form type used to construct the button.

getDataMapper()

Unsupported method.

bool
getRequired()

Unsupported method.

bool
getDisabled()

Returns whether the button is disabled.

bool
getErrorBubbling()

Unsupported method.

mixed
getEmptyData()

Unsupported method.

array
getAttributes()

Returns additional attributes of the button.

bool
hasAttribute(string $name)

Returns whether the attribute with the given name exists.

mixed
getAttribute(string $name, mixed $default = null)

Returns the value of the given attribute.

mixed
getData()

Unsupported method.

string
getDataClass()

Unsupported method.

bool
getDataLocked()

Unsupported method.

getFormFactory()

Unsupported method.

string
getAction()

Unsupported method.

string
getMethod()

Unsupported method.

bool
getAutoInitialize()

Unsupported method.

bool
getInheritData()

Unsupported method.

array
getOptions()

Returns all options passed during the construction of the button.

bool
hasOption(string $name)

Returns whether a specific option exists.

mixed
getOption(string $name, mixed $default = null)

Returns the value of a specific option.

int
count()

Unsupported method.

getIterator()

Unsupported method.

Details

at line line 63
__construct(string $name, array $options = array())

Creates a new button builder.

Parameters

string $name The name of the button.
array $options The button's options.

Exceptions

InvalidArgumentException If the name is empty.

at line line 84
FormBuilderInterface add(string|int|FormBuilderInterface $child, string|FormTypeInterface $type = null, array $options = array())

Unsupported method.

This method should not be invoked.

Parameters

string|int|FormBuilderInterface $child
string|FormTypeInterface $type
array $options

Return Value

FormBuilderInterface The builder object.

Exceptions

BadMethodCallException

at line line 100
FormBuilderInterface create(string $name, string|FormTypeInterface $type = null, array $options = array())

Unsupported method.

This method should not be invoked.

Parameters

string $name The name of the form or the name of the property
string|FormTypeInterface $type The type of the form or null if name is a property
array $options The options

Return Value

FormBuilderInterface The created builder.

Exceptions

BadMethodCallException

at line line 114
FormBuilderInterface get(string $name)

Unsupported method.

This method should not be invoked.

Parameters

string $name The name of the child

Return Value

FormBuilderInterface The builder for the child

Exceptions

BadMethodCallException

at line line 128
FormBuilderInterface remove(string $name)

Unsupported method.

This method should not be invoked.

Parameters

string $name

Return Value

FormBuilderInterface The builder object.

Exceptions

BadMethodCallException

at line line 140
bool has(string $name)

Unsupported method.

Parameters

string $name

Return Value

bool

at line line 150
array all()

Returns the children.

Return Value

array

at line line 160
Form getForm()

Creates the button.

Return Value

Form The form

at line line 176
FormConfigBuilderInterface addEventListener(string $eventName, callable $listener, int $priority)

Unsupported method.

This method should not be invoked.

Parameters

string $eventName The name of the event to listen to.
callable $listener The listener to execute.
int $priority The priority of the listener. Listeners with a higher priority are called before listeners with a lower priority.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 190
FormConfigBuilderInterface addEventSubscriber(EventSubscriberInterface $subscriber)

Unsupported method.

This method should not be invoked.

Parameters

EventSubscriberInterface $subscriber The subscriber to attach.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 205
FormConfigBuilderInterface addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false)

Unsupported method.

This method should not be invoked.

Parameters

DataTransformerInterface $viewTransformer
bool $forcePrepend if set to true, prepend instead of appending

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 217
FormConfigBuilderInterface resetViewTransformers()

Unsupported method.

This method should not be invoked.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 232
FormConfigBuilderInterface addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false)

Unsupported method.

This method should not be invoked.

Parameters

DataTransformerInterface $modelTransformer
bool $forceAppend if set to true, append instead of prepending

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 244
FormConfigBuilderInterface resetModelTransformers()

Unsupported method.

This method should not be invoked.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 252
FormConfigBuilderInterface setAttribute(string $name, mixed $value)

Sets the value for an attribute.

Parameters

string $name The name of the attribute
mixed $value The value of the attribute

Return Value

FormConfigBuilderInterface The configuration object.

at line line 262
FormConfigBuilderInterface setAttributes(array $attributes)

Sets the attributes.

Parameters

array $attributes The attributes.

Return Value

FormConfigBuilderInterface The configuration object.

at line line 278
FormConfigBuilderInterface setDataMapper(DataMapperInterface $dataMapper = null)

Unsupported method.

This method should not be invoked.

Parameters

DataMapperInterface $dataMapper

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 290
FormConfigBuilderInterface setDisabled(bool $disabled)

Set whether the button is disabled.

Parameters

bool $disabled Whether the form is disabled

Return Value

FormConfigBuilderInterface The configuration object.

at line line 306
FormConfigBuilderInterface setEmptyData(mixed $emptyData)

Unsupported method.

This method should not be invoked.

Parameters

mixed $emptyData The empty data.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 320
FormConfigBuilderInterface setErrorBubbling(bool $errorBubbling)

Unsupported method.

This method should not be invoked.

Parameters

bool $errorBubbling

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 334
FormConfigBuilderInterface setRequired(bool $required)

Unsupported method.

This method should not be invoked.

Parameters

bool $required

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 348
FormConfigBuilderInterface setPropertyPath(null|string|PropertyPathInterface $propertyPath)

Unsupported method.

This method should not be invoked.

Parameters

null|string|PropertyPathInterface $propertyPath The property path or null if the path should be set automatically based on the form's name.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 362
FormConfigBuilderInterface setMapped(bool $mapped)

Unsupported method.

This method should not be invoked.

Parameters

bool $mapped Whether the form should be mapped.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 376
FormConfigBuilderInterface setByReference(bool $byReference)

Unsupported method.

This method should not be invoked.

Parameters

bool $byReference Whether the data should be modified by reference.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 390
FormConfigBuilderInterface setCompound(bool $compound)

Unsupported method.

This method should not be invoked.

Parameters

bool $compound Whether the form should be compound.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 402
FormConfigBuilderInterface setType(ResolvedFormTypeInterface $type)

Sets the type of the button.

Parameters

ResolvedFormTypeInterface $type The type of the form.

Return Value

FormConfigBuilderInterface The configuration object.

at line line 418
FormConfigBuilderInterface setData(mixed $data)

Unsupported method.

This method should not be invoked.

Parameters

mixed $data The data of the form in application format.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 432
FormConfigBuilderInterface setDataLocked(bool $locked)

Unsupported method.

This method should not be invoked.

Parameters

bool $locked Whether to lock the default data.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 446
setFormFactory(FormFactoryInterface $formFactory)

Unsupported method.

This method should not be invoked.

Parameters

FormFactoryInterface $formFactory The form factory.

Exceptions

BadMethodCallException

at line line 458
FormConfigBuilderInterface setAction(string $action)

Unsupported method.

Parameters

string $action The target URL of the form.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 470
FormConfigBuilderInterface setMethod(string $method)

Unsupported method.

Parameters

string $method The HTTP method of the form.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 482
FormConfigBuilderInterface setRequestHandler(RequestHandlerInterface $requestHandler)

Unsupported method.

Parameters

RequestHandlerInterface $requestHandler

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 496
FormConfigBuilderInterface setAutoInitialize(bool $initialize)

Unsupported method.

Parameters

bool $initialize True to initialize the form automatically, false to suppress automatic initialization. In the second case, you need to call {@link FormInterface::initialize()} manually.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 512
FormConfigBuilderInterface setInheritData(bool $inheritData)

Unsupported method.

Parameters

bool $inheritData Whether the form should inherit its parent's data.

Return Value

FormConfigBuilderInterface The configuration object.

Exceptions

BadMethodCallException

at line line 522
FormConfigInterface getFormConfig()

Builds and returns the button configuration.

Return Value

FormConfigInterface

at line line 534
EventDispatcherInterface getEventDispatcher()

Unsupported method.

Return Value

EventDispatcherInterface The dispatcher.

at line line 541
string getName()

Returns the name of the form used as HTTP parameter.

Return Value

string The form name.

at line line 549
null|PropertyPathInterface getPropertyPath()

Unsupported method.

Return Value

null|PropertyPathInterface The property path.

at line line 558
bool getMapped()

Unsupported method.

Return Value

bool Whether the form is mapped.

at line line 568
bool getByReference()

Unsupported method.

Return Value

bool Whether to modify the form's data by reference.

at line line 578
bool getCompound()

Unsupported method.

Return Value

bool Whether the form is compound.

at line line 588
ResolvedFormTypeInterface getType()

Returns the form type used to construct the button.

Return Value

ResolvedFormTypeInterface The form's type.

at line line 598
DataTransformerInterface[] getViewTransformers()

Unsupported method.

Return Value

DataTransformerInterface[] An array of {@link DataTransformerInterface} instances.

at line line 608
DataTransformerInterface[] getModelTransformers()

Unsupported method.

Return Value

DataTransformerInterface[] An array of {@link DataTransformerInterface} instances.

at line line 616
DataMapperInterface getDataMapper()

Unsupported method.

Return Value

DataMapperInterface The data mapper.

at line line 625
bool getRequired()

Unsupported method.

Return Value

bool Whether the form is required.

at line line 635
bool getDisabled()

Returns whether the button is disabled.

Return Value

bool Whether the form is disabled.

at line line 645
bool getErrorBubbling()

Unsupported method.

Return Value

bool Whether errors will bubble up.

at line line 653
mixed getEmptyData()

Unsupported method.

Return Value

mixed The data returned if the form is empty.

at line line 662
array getAttributes()

Returns additional attributes of the button.

Return Value

array An array of key-value combinations.

at line line 674
bool hasAttribute(string $name)

Returns whether the attribute with the given name exists.

Parameters

string $name The attribute name.

Return Value

bool Whether the attribute exists.

at line line 687
mixed getAttribute(string $name, mixed $default = null)

Returns the value of the given attribute.

Parameters

string $name The attribute name.
mixed $default The value returned if the attribute does not exist.

Return Value

mixed The attribute value.

at line line 695
mixed getData()

Unsupported method.

Return Value

mixed The initial form data.

at line line 702
string getDataClass()

Unsupported method.

Return Value

string The data class or null.

at line line 711
bool getDataLocked()

Unsupported method.

Return Value

bool Whether the data is locked.

at line line 719
FormFactoryInterface getFormFactory()

Unsupported method.

Return Value

FormFactoryInterface The form factory.

at line line 726
string getAction()

Unsupported method.

Return Value

string The target URL of the form.

at line line 733
string getMethod()

Unsupported method.

Return Value

string The HTTP method of the form.

at line line 740
RequestHandlerInterface getRequestHandler()

Unsupported method.

Return Value

RequestHandlerInterface The request handler.

at line line 749
bool getAutoInitialize()

Unsupported method.

Return Value

bool Returns true if the form should be initialized when created, false otherwise.

at line line 759
bool getInheritData()

Unsupported method.

Return Value

bool Whether the form should inherit its parent's data.

at line line 769
array getOptions()

Returns all options passed during the construction of the button.

Return Value

array The passed options.

at line line 781
bool hasOption(string $name)

Returns whether a specific option exists.

Parameters

string $name The option name,

Return Value

bool Whether the option exists.

at line line 794
mixed getOption(string $name, mixed $default = null)

Returns the value of a specific option.

Parameters

string $name The option name.
mixed $default The value returned if the option does not exist.

Return Value

mixed The option value.

at line line 804
int count()

Unsupported method.

Return Value

int Always returns 0.

at line line 814
EmptyIterator getIterator()

Unsupported method.

Return Value

EmptyIterator Always returns an empty iterator.