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
Inherited

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

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

Parameters

$elementOrFieldset

array\Traversable\Zend\Form\ElementInterface

$flags

array

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Get allow add

allowAdd() : bool

Returns

bool

Checks if the object can be set in this fieldset

allowObjectBinding(object $object) : bool

Parameters

$object

object

Returns

bool

allowRemove()

allowRemove() : bool

Returns

bool

Checks if this fieldset can bind data

allowValueBinding() : bool

Returns

bool

Get The class or interface of objects that can be bound to this fieldset.

allowedObjectBindingClass() : string
Inherited

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

Returns

string

Bind values to the object

bindValues(array $values) : array | mixed | void

Parameters

$values

array

Returns

arraymixedvoid

Clear all attributes

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

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

Returns

Clear all label options

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

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

Returns

Countable: return count of attached elements/fieldsets

count() : int
Inherited

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

Returns

int

createNewObjects()

createNewObjects() : bool

Returns

bool

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 initial count of target element

getCount() : int

Returns

int

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

If no hydrator is present and object implements HydratorAwareInterface, hydrator will be retrieved from the object.

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

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

Returns

IteratorAggregate: return internal iterator

getIterator() : \Zend\Stdlib\PriorityQueue
Inherited

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

Returns

Retrieve the label used for this element

getLabel() : null | string
Inherited

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

Returns

nullstring

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

Retrieve a single label option

getLabelOption($key) : mixed | null
Inherited

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

Parameters

$key

Returns

mixednull

Get label specific options

getLabelOptions() : array
Inherited

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

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

Get target element

getTargetElement() : \Zend\Form\ElementInterface | null

Get a template element used for rendering purposes only

getTemplateElement() : null | \Zend\Form\ElementInterface | \Zend\Form\FieldsetInterface

Get the template placeholder

getTemplatePlaceholder() : string

Returns

string

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

Does the element has a specific label option ?

hasLabelOption(string $key) : bool
Inherited

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

Parameters

$key

string

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()

Populate values

populateValues(array | \Traversable $data) : void

Prepare the collection by adding a dummy template element if the user want one

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

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

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

Remove a single label option

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

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

Parameters

$key

string

Returns

Remove many attributes at once

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

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

Parameters

$keys

array

Returns

Get allow add

setAllowAdd(bool $allowAdd) : \Zend\Form\Element\Collection

Parameters

$allowAdd

bool

Returns

setAllowRemove()

setAllowRemove(bool $allowRemove) : \Zend\Form\Element\Collection

Parameters

$allowRemove

bool

Returns

Set the class or interface of objects that can be bound to this fieldset.

setAllowedObjectBindingClass(string $allowObjectBindingClass) 
Inherited

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

Parameters

$allowObjectBindingClass

string

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 initial count of target element

setCount($count) : \Zend\Form\Element\Collection

Parameters

$count

Returns

setCreateNewObjects()

setCreateNewObjects(bool $createNewObjects) : \Zend\Form\Element\Collection

Parameters

$createNewObjects

bool

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
Inherited

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

Parameters

Returns

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 single label optionn

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

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

Parameters

$key

string

$value

mixed

Returns

Set many label options at once

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

Implementation will decide if this will overwrite or merge.

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

Parameters

$arrayOrTraversable

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

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 In this case the "object" is a collection of objects

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

Set a single option for an element

setOption(string $key, mixed $value) : \Zend\Form\self
Inherited

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

Parameters

$key

string

$value

mixed

Returns

\Zend\Form\self

Accepted options for Collection: - target_element: an array or element used in the collection - count: number of times the element is added initially - allow_add: if set to true, elements can be added to the form dynamically (using JavaScript) - allow_remove: if set to true, elements can be removed to the form - should_create_template: if set to true, a template is generated (inside a <span>) - template_placeholder: placeholder used in the data template

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

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

Parameters

$options

array\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

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

If set to true, a template prototype is automatically added to the form to ease the creation of dynamic elements through JavaScript

setShouldCreateTemplate(bool $shouldCreateTemplate) : \Zend\Form\Element\Collection

Parameters

$shouldCreateTemplate

bool

Returns

Set the target element

setTargetElement(\Zend\Form\ElementInterface | array | \Traversable $elementOrFieldset) : \Zend\Form\Element\Collection

Parameters

$elementOrFieldset

\Zend\Form\ElementInterfacearray\Traversable

Exceptions

\Zend\Form\Exception\InvalidArgumentException

Returns

Set the placeholder used in the template generated to help create new elements in JavaScript

setTemplatePlaceholder(string $templatePlaceholder) : \Zend\Form\Element\Collection

Parameters

$templatePlaceholder

string

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

Get if the collection should create a template

shouldCreateTemplate() : bool

Returns

bool

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

useAsBaseFieldset() : bool
Inherited

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

Returns

bool

Add a new instance of the target element

addNewTargetElementInstance(string $name) : \Zend\Form\ElementInterface

Parameters

$name

string

Exceptions

\Zend\Form\Exception\DomainException

Returns

Create a new instance of the target element

createNewTargetElementInstance() : \Zend\Form\ElementInterface

Create a dummy template element

createTemplateElement() : null | \Zend\Form\ElementInterface | \Zend\Form\FieldsetInterface

Replaces the default template object of a sub element with the corresponding real entity so that all properties are preserved.

replaceTemplateObjects() : void

 Properties

 

Are new elements allowed to be added dynamically ?

$allowAdd : bool

 

Are existing elements allowed to be removed dynamically ?

$allowRemove : bool

 

The class or interface of objects that can be bound to this fieldset.

$allowedObjectBindingClass : string
Inherited

inherited_from \Zend\Form\Fieldset::$$allowedObjectBindingClass
 

$attributes

$attributes : array
Inherited

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

$byName

$byName : \Zend\Form\ElementInterface[]
Inherited

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

Initial count of target element

$count : int

 

Whether or not to create new objects during modify

$createNewObjects : bool

 

$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
 

Hydrator to use with bound object

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

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

$iterator

$iterator : \Zend\Stdlib\PriorityQueue
Inherited

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

$label

$label : null | 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
 

Label specific options

$labelOptions : array
Inherited

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

The index of the last child element or fieldset

$lastChildIndex : int

 

$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
 

Should child elements must be created on self::prepareElement()?

$shouldCreateChildrenOnPrepareElement : bool

 

Is the template generated ?

$shouldCreateTemplate : bool

 

Element used in the collection

$targetElement : \Zend\Form\ElementInterface

 

Element used as a template

$templateElement : \Zend\Form\ElementInterface | \Zend\Form\FieldsetInterface

 

Placeholder used in template content for making your life easier with JavaScript

$templatePlaceholder : string

 

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

$useAsBaseFieldset : bool
Inherited

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

$value

$value : mixed
Inherited

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

 Constants

 

Default template placeholder

DEFAULT_TEMPLATE_PLACEHOLDER