Methods

Make a deep clone of a fieldset

__clone() : void
Inherited

inherited_from \Zend\Form\Fieldset::__clone()

__construct()

__construct(null | int | string $name, array $options) 
Inherited

inherited_from \Zend\Form\Fieldset::__construct()

Parameters

$name

nullintstring

Optional name for the element

$options

array

Optional options for the element

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Add an element or fieldset

add(array | \Traversable | \Zend\Form\ElementInterface $elementOrFieldset, array $flags) : \Zend\Form\Fieldset | \Zend\Form\FieldsetInterface | \Zend\Form\FormInterface

If $elementOrFieldset is an array or Traversable, passes the argument on to the composed factory to create the object before attaching it.

$flags could contain metadata such as the alias under which to register the element or fieldset, order in which to prioritize it, etc.

Parameters

$elementOrFieldset

array\Traversable\Zend\Form\ElementInterface

$flags

array

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Checks if the object can be set in this fieldset

allowObjectBinding(object $object) : bool
Inherited

inherited_from \Zend\Form\Fieldset::allowObjectBinding()

Parameters

$object

object

Returns

bool

Checks if this fieldset can bind data

allowValueBinding() : bool
Inherited

inherited_from \Zend\Form\Fieldset::allowValueBinding()

Returns

bool

Attach defaults provided by the elements to the input filter

attachInputFilterDefaults(\Zend\InputFilter\InputFilterInterface $inputFilter, \Zend\Form\FieldsetInterface $fieldset) : void

Parameters

$fieldset

\Zend\Form\FieldsetInterface

Fieldset to traverse when looking for default inputs

Bind an object to the form

bind(object $object, int $flags) : mixed | void

Ensures the object is populated with validated values.

Parameters

$object

object

$flags

int

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

mixedvoid

Will we bind values to the bound object on successful validation?

bindOnValidate() : bool

Returns

bool

Bind values to the bound object

bindValues(array $values) : mixed

Parameters

$values

array

Returns

mixed

Clear all attributes

clearAttributes() : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::clearAttributes()
inherited_from \Zend\Form\Fieldset::clearAttributes()

Returns

Countable: return count of attached elements/fieldsets

count() : int
Inherited

inherited_from \Zend\Form\Fieldset::count()

Returns

int

Retrieve a named element or fieldset

get(string $elementOrFieldset) : \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Fieldset::get()

Parameters

$elementOrFieldset

string

Returns

Retrieve a single element attribute

getAttribute($key) : mixed | null
Inherited

inherited_from \Zend\Form\Element::getAttribute()
inherited_from \Zend\Form\Fieldset::getAttribute()

Parameters

$key

Returns

mixednull

Retrieve all attributes at once

getAttributes() : array | \Traversable
Inherited

inherited_from \Zend\Form\Element::getAttributes()
inherited_from \Zend\Form\Fieldset::getAttributes()

Returns

array\Traversable

Get the base fieldset to use when hydrating

getBaseFieldset() : \Zend\Form\FieldsetInterface

Retrieve the validated data

getData(int $flag) : array | object

By default, retrieves normalized values; pass one of the FormInterface::VALUES_* constants to shape the behavior.

Parameters

$flag

int

Exceptions

\Zend\Form\Exception\DomainException

Returns

arrayobject

Retrieve all attached elements

getElements() : array | \Traversable
Inherited

Storage is an implementation detail of the concrete class.

inherited_from \Zend\Form\Fieldset::getElements()

Returns

array\Traversable

Retrieve all attached fieldsets

getFieldsets() : array | \Traversable
Inherited

Storage is an implementation detail of the concrete class.

inherited_from \Zend\Form\Fieldset::getFieldsets()

Returns

array\Traversable

Retrieve composed form factory

getFormFactory() : \Zend\Form\Factory
Inherited

Lazy-loads one if none present.

inherited_from \Zend\Form\Fieldset::getFormFactory()

Returns

Get the hydrator used when binding an object to the fieldset

getHydrator() : \Zend\Stdlib\Hydrator\HydratorInterface
Inherited

Will lazy-load Hydrator\ArraySerializable if none is present.

inherited_from \Zend\Form\Fieldset::getHydrator()

Returns

Retrieve input filter used by this form

getInputFilter() : null | \Zend\InputFilter\InputFilterInterface

IteratorAggregate: return internal iterator

getIterator() : \Zend\Stdlib\PriorityQueue
Inherited

inherited_from \Zend\Form\Fieldset::getIterator()

Returns

Retrieve the label used for this element

getLabel() : string
Inherited

inherited_from \Zend\Form\Element::getLabel()
inherited_from \Zend\Form\Fieldset::getLabel()

Returns

string

Get the attributes to use with the label

getLabelAttributes() : array
Inherited

inherited_from \Zend\Form\Element::getLabelAttributes()
inherited_from \Zend\Form\Fieldset::getLabelAttributes()

Returns

array

Get validation error messages, if any

getMessages(null | string $elementName) : array | \Traversable
Inherited

Returns a hash of element names/messages for all elements failing validation, or, if $elementName is provided, messages for that element only.

inherited_from \Zend\Form\Fieldset::getMessages()

Parameters

$elementName

nullstring

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

array\Traversable

Get value for name

getName() : string | int
Inherited

inherited_from \Zend\Form\Element::getName()
inherited_from \Zend\Form\Fieldset::getName()

Returns

stringint

Get the object used by the hydrator

getObject() : mixed
Inherited

inherited_from \Zend\Form\Fieldset::getObject()

Returns

mixed

Return the specified option

getOption(string $option) : NULL | mixed
Inherited

inherited_from \Zend\Form\Element::getOption()
inherited_from \Zend\Form\Fieldset::getOption()

Parameters

$option

string

Returns

NULLmixed

Get defined options

getOptions() : array
Inherited

inherited_from \Zend\Form\Element::getOptions()
inherited_from \Zend\Form\Fieldset::getOptions()

Returns

array

Should we use form input filter over element input filter defaults from elements and fieldsets?

getPreferFormInputFilter() : bool

Returns

bool

Retrieve the current validation group, if any

getValidationGroup() : null | array

Returns

nullarray

Retrieve the element value

getValue() : mixed
Inherited

inherited_from \Zend\Form\Element::getValue()
inherited_from \Zend\Form\Fieldset::getValue()

Returns

mixed

Does the fieldset have an element/fieldset by the given name?

has(string $elementOrFieldset) : bool
Inherited

inherited_from \Zend\Form\Fieldset::has()

Parameters

$elementOrFieldset

string

Returns

bool

Does the element has a specific attribute ?

hasAttribute(string $key) : bool
Inherited

inherited_from \Zend\Form\Element::hasAttribute()
inherited_from \Zend\Form\Fieldset::hasAttribute()

Parameters

$key

string

Returns

bool

Check if the form has been validated

hasValidated() : bool

Returns

bool

This function is automatically called when creating element with factory.

init() : void
Inherited

It allows to perform various operations (add elements...)

inherited_from \Zend\Form\Element::init()
inherited_from \Zend\Form\Fieldset::init()

Validate the form

isValid() : bool

Typically, will proxy to the composed input filter.

Exceptions

\Zend\Form\Exception\DomainException

Returns

bool

Recursively populate values of attached elements and fieldsets

populateValues(array | \Traversable $data) : void
Inherited

inherited_from \Zend\Form\Fieldset::populateValues()

Parameters

$data

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Ensures state is ready for use

prepare() : \Zend\Form\Form

Marshalls the input filter, to ensure validation error messages are available, and prepares any elements and/or fieldsets that require preparation.

Returns

Ensures state is ready for use.

prepareElement(\Zend\Form\FormInterface $form) : mixed | void
Inherited

Here, we append the name of the fieldsets to every elements in order to avoid name clashes if the same fieldset is used multiple times

inherited_from \Zend\Form\Fieldset::prepareElement()

Parameters

Returns

mixedvoid

Remove a named element or fieldset

remove(string $elementOrFieldset) : \Zend\Form\FieldsetInterface
Inherited

inherited_from \Zend\Form\Fieldset::remove()

Parameters

$elementOrFieldset

string

Returns

Remove a single attribute

removeAttribute(string $key) : \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::removeAttribute()
inherited_from \Zend\Form\Fieldset::removeAttribute()

Parameters

$key

string

Returns

Remove many attributes at once

removeAttributes(array $keys) : \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::removeAttributes()
inherited_from \Zend\Form\Fieldset::removeAttributes()

Parameters

$keys

array

Returns

Set a single element attribute

setAttribute(string $key, mixed $value) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::setAttribute()
inherited_from \Zend\Form\Fieldset::setAttribute()

Parameters

$key

string

$value

mixed

Returns

Set many attributes at once

setAttributes(array | \Traversable $arrayOrTraversable) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

Implementation will decide if this will overwrite or merge.

inherited_from \Zend\Form\Element::setAttributes()
inherited_from \Zend\Form\Fieldset::setAttributes()

Parameters

$arrayOrTraversable

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set the base fieldset to use when hydrating

setBaseFieldset(\Zend\Form\FieldsetInterface $baseFieldset) : \Zend\Form\Form

Set flag indicating whether or not to bind values on successful validation

setBindOnValidate(int $bindOnValidateFlag) : void | \Zend\Form\Form

Parameters

$bindOnValidateFlag

int

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set data to validate and/or populate elements

setData(array | \ArrayAccess | \Traversable $data) : \Zend\Form\Form | \Zend\Form\FormInterface

Typically, also passes data on to the composed input filter.

Parameters

$data

array\ArrayAccess\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Compose a form factory to use when calling add() with a non-element/fieldset

setFormFactory(\Zend\Form\Factory $factory) : \Zend\Form\Form
Inherited

inherited_from \Zend\Form\Fieldset::setFormFactory()

Parameters

Returns

Set the hydrator to use when binding an object to the element

setHydrator(\Zend\Stdlib\Hydrator\HydratorInterface $hydrator) : \Zend\Form\FieldsetInterface

Set the input filter used by this form

setInputFilter(\Zend\InputFilter\InputFilterInterface $inputFilter) : \Zend\Form\FormInterface

Set the label used for this element

setLabel($label) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::setLabel()
inherited_from \Zend\Form\Fieldset::setLabel()

Parameters

$label

Returns

Set the attributes to use with the label

setLabelAttributes(array $labelAttributes) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

inherited_from \Zend\Form\Element::setLabelAttributes()
inherited_from \Zend\Form\Fieldset::setLabelAttributes()

Parameters

$labelAttributes

array

Returns

Set a hash of element names/messages to use when validation fails

setMessages(array | \Traversable $messages) : \Zend\Form\Element | \Zend\Form\ElementInterface | \Zend\Form\FieldsetInterface
Inherited

inherited_from \Zend\Form\Fieldset::setMessages()

Parameters

$messages

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set value for name

setName(string $name) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

In most cases, this will proxy to the attributes for storage, but is present to indicate that elements are generally named.

inherited_from \Zend\Form\Element::setName()
inherited_from \Zend\Form\Fieldset::setName()

Parameters

$name

string

Returns

Set the object used by the hydrator

setObject(object $object) : \Zend\Form\Fieldset | \Zend\Form\FieldsetInterface
Inherited

inherited_from \Zend\Form\Fieldset::setObject()

Parameters

$object

object

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set options for a fieldset.

setOptions(array | \Traversable $options) : \Zend\Form\Element | \Zend\Form\ElementInterface
Inherited

Accepted options are: - use_as_base_fieldset: is this fieldset use as the base fieldset?

inherited_from \Zend\Form\Fieldset::setOptions()

Parameters

$options

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults

setPreferFormInputFilter(bool $preferFormInputFilter) : \Zend\Form\Form

Parameters

$preferFormInputFilter

bool

Returns

Set/change the priority of an element or fieldset

setPriority(string $elementOrFieldset, int $priority) : \Zend\Form\FieldsetInterface
Inherited

inherited_from \Zend\Form\Fieldset::setPriority()

Parameters

$elementOrFieldset

string

$priority

int

Returns

Set if this fieldset is used as a base fieldset

setUseAsBaseFieldset(bool $useAsBaseFieldset) : \Zend\Form\Fieldset
Inherited

inherited_from \Zend\Form\Fieldset::setUseAsBaseFieldset()

Parameters

$useAsBaseFieldset

bool

Returns

Set flag indicating whether or not to scan elements and fieldsets for defaults

setUseInputFilterDefaults(bool $useInputFilterDefaults) : \Zend\Form\Form

Parameters

$useInputFilterDefaults

bool

Returns

Set the validation group (set of values to validate)

setValidationGroup() : \Zend\Form\Form | \Zend\Form\FormInterface

Typically, proxies to the composed input filter

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set the element value

setValue(mixed $value) : \Zend\Form\Element
Inherited

inherited_from \Zend\Form\Element::setValue()
inherited_from \Zend\Form\Fieldset::setValue()

Parameters

$value

mixed

Returns

Are the form elements/fieldsets names wrapped by the form name ?

setWrapElements(bool $wrapElements) : \Zend\Form\Form

Parameters

$wrapElements

bool

Returns

Is this fieldset use as a base fieldset for a form ?

useAsBaseFieldset() : bool
Inherited

inherited_from \Zend\Form\Fieldset::useAsBaseFieldset()

Returns

bool

Should we use input filter defaults from elements and fieldsets?

useInputFilterDefaults() : bool

Returns

bool

If true, form elements/fieldsets name's are wrapped around the form name itself

wrapElements() : bool

Returns

bool

Recursively extract values for elements and sub-fieldsets, and populate form values

extract() : array

Returns

array

Parse filtered values and return only posted fields for binding

prepareBindData(array $values, array $match) : array

Parameters

$values

array

$match

array

Returns

array

Prepare the validation group in case Collection elements were used (this function also handle the case where elements could have been dynamically added or removed from a collection using JavaScript)

prepareValidationGroup(\Zend\Form\FieldsetInterface $formOrFieldset, array $data, array $validationGroup) 

Parameters

$data

array

$validationGroup

array

 Properties

 

Seed attributes

$attributes : array

 

Base fieldset to use for hydrating (if none specified, directly hydrate elements)

$baseFieldset : \Zend\Form\FieldsetInterface

 

How to bind values to the attached object

$bindAs : int

 

Whether or not to bind values to the bound object on successful validation

$bindOnValidate : int

 

$byName

$byName : array
Inherited

inherited_from \Zend\Form\Fieldset::$$byName
 

Data being validated

$data : null | array | \Traversable

 

$elements

$elements : array
Inherited

inherited_from \Zend\Form\Fieldset::$$elements
 

$factory

$factory : \Zend\Form\Factory
Inherited

inherited_from \Zend\Form\Fieldset::$$factory
 

$fieldsets

$fieldsets : array
Inherited

inherited_from \Zend\Form\Fieldset::$$fieldsets
 

$filter

$filter : null | \Zend\InputFilter\InputFilterInterface

 

Has the input filter defaults been added already ?

$hasAddedInputFilterDefaults : bool

 

Whether or not validation has occurred

$hasValidated : bool

 

Hydrator to use with bound object

$hydrator : \Zend\Stdlib\Hydrator\HydratorInterface
Inherited

inherited_from \Zend\Form\Fieldset::$$hydrator
 

Is the form prepared ?

$isPrepared : bool

 

Result of last validation operation

$isValid : bool

 

$iterator

$iterator : \Zend\Stdlib\PriorityQueue
Inherited

inherited_from \Zend\Form\Fieldset::$$iterator
 

$label

$label : string
Inherited

inherited_from \Zend\Form\Element::$$label
inherited_from \Zend\Form\Fieldset::$$label
 

$labelAttributes

$labelAttributes : array
Inherited

inherited_from \Zend\Form\Element::$$labelAttributes
inherited_from \Zend\Form\Fieldset::$$labelAttributes
 

$messages

$messages : array
Inherited

inherited_from \Zend\Form\Fieldset::$$messages
 

The object bound to this fieldset, if any

$object : null | object
Inherited

inherited_from \Zend\Form\Fieldset::$$object
 

<p>custom options</p>

$options : array
Inherited

inherited_from \Zend\Form\Element::$$options
inherited_from \Zend\Form\Fieldset::$$options
 

Prefer form input filter over input filter defaults

$preferFormInputFilter : bool

 

Should this fieldset be used as a base fieldset in the parent form ?

$useAsBaseFieldset : bool
Inherited

inherited_from \Zend\Form\Fieldset::$$useAsBaseFieldset
 

Whether or not to automatically scan for input filter defaults on attached fieldsets and elements

$useInputFilterDefaults : bool

 

Validation group, if any

$validationGroup : null | array

 

$value

$value : mixed
Inherited

inherited_from \Zend\Form\Element::$$value
inherited_from \Zend\Form\Fieldset::$$value
 

Are the form elements/fieldsets wrapped by the form name ?

$wrapElements : bool

 Constants

 

BIND_MANUAL

BIND_MANUAL 
Inherited

inherited_from \Zend\Form\FormInterface::BIND_MANUAL
 

BIND_ON_VALIDATE

BIND_ON_VALIDATE 
Inherited

inherited_from \Zend\Form\FormInterface::BIND_ON_VALIDATE
 

VALIDATE_ALL

VALIDATE_ALL 
Inherited

inherited_from \Zend\Form\FormInterface::VALIDATE_ALL
 

VALUES_AS_ARRAY

VALUES_AS_ARRAY 
Inherited

inherited_from \Zend\Form\FormInterface::VALUES_AS_ARRAY
 

VALUES_NORMALIZED

VALUES_NORMALIZED 
Inherited

inherited_from \Zend\Form\FormInterface::VALUES_NORMALIZED
 

VALUES_RAW

VALUES_RAW 
Inherited

inherited_from \Zend\Form\FormInterface::VALUES_RAW