760. Class

760.1. Zend\Form\Fieldset

760.1.1. Methods

760.1.1.1. __construct

__construct()

@param null|int|string $name Optional name for the element

Parameters:array – Optional options for the element

760.1.1.2. setOptions

setOptions()

Set options for a fieldset. Accepted options are: - use_as_base_fieldset: is this fieldset use as the base fieldset?

Parameters:array|Traversable
Return type:Element|ElementInterface
Throws :ExceptionInvalidArgumentException

760.1.1.3. setFormFactory

setFormFactory()

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

Parameters:Factory
Return type:Form

760.1.1.4. getFormFactory

getFormFactory()

Retrieve composed form factory

Lazy-loads one if none present.

Return type:Factory

760.1.1.5. add

add()

Add an element or fieldset

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

Parameters:
  • array|Traversable|ElementInterface
  • array
Return type:

Fieldset|FieldsetInterface

Throws :

ExceptionInvalidArgumentException

760.1.1.6. has

has()

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

Parameters:string
Return type:bool

760.1.1.7. get

get()

Retrieve a named element or fieldset

Parameters:string
Return type:ElementInterface

760.1.1.8. remove

remove()

Remove a named element or fieldset

Parameters:string
Return type:FieldsetInterface

760.1.1.9. setPriority

setPriority()

Set/change the priority of an element or fieldset

Parameters:
  • string
  • int
Return type:

FieldsetInterface

760.1.1.10. getElements

getElements()

Retrieve all attached elements

Storage is an implementation detail of the concrete class.

Return type:array|Traversable

760.1.1.11. getFieldsets

getFieldsets()

Retrieve all attached fieldsets

Storage is an implementation detail of the concrete class.

Return type:array|Traversable

760.1.1.12. setMessages

setMessages()

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

Parameters:array|Traversable
Return type:Element|ElementInterface|FieldsetInterface
Throws :ExceptionInvalidArgumentException

760.1.1.13. getMessages

getMessages()

Get validation error messages, if any

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

Parameters:null|string
Return type:array|Traversable
Throws :ExceptionInvalidArgumentException

760.1.1.14. prepareElement

prepareElement()

Ensures state is ready for use. 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:FormInterface
Return type:mixed|void

760.1.1.15. populateValues

populateValues()

Recursively populate values of attached elements and fieldsets

Parameters:array|Traversable
Return type:void
Throws :ExceptionInvalidArgumentException

760.1.1.16. count

count()

Countable: return count of attached elements/fieldsets

Return type:int

760.1.1.17. getIterator

getIterator()

IteratorAggregate: return internal iterator

Return type:PriorityQueue

760.1.1.18. setObject

setObject()

Set the object used by the hydrator

Parameters:object
Return type:Fieldset|FieldsetInterface
Throws :ExceptionInvalidArgumentException

760.1.1.19. getObject

getObject()

Get the object used by the hydrator

Return type:mixed

760.1.1.20. allowObjectBinding

allowObjectBinding()

Checks if the object can be set in this fieldset

Parameters:object
Return type:bool

760.1.1.21. setHydrator

setHydrator()

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

Parameters:HydratorInterface
Return type:FieldsetInterface

760.1.1.22. getHydrator

getHydrator()

Get the hydrator used when binding an object to the fieldset

Will lazy-load HydratorArraySerializable if none is present.

Return type:HydratorInterface

760.1.1.23. allowValueBinding

allowValueBinding()

Checks if this fieldset can bind data

Return type:bool

760.1.1.24. bindValues

bindValues()

Bind values to the bound object

Parameters:array
Return type:mixed|void

760.1.1.25. setUseAsBaseFieldset

setUseAsBaseFieldset()

Set if this fieldset is used as a base fieldset

Parameters:bool
Return type:Fieldset

760.1.1.26. useAsBaseFieldset

useAsBaseFieldset()

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

Return type:bool

760.1.1.27. extract

extract()

Extract values from the bound object

Return type:array

760.1.1.28. __clone

__clone()

Make a deep clone of a fieldset

Return type:void