Zend Framework
3.0
|
Public Member Functions | |
__construct ($name=null, $options=[]) | |
setOptions ($options) | |
Set options for a fieldset. | |
setFormFactory (Factory $factory) | |
Compose a form factory to use when calling add() with a non-element/fieldset. | |
getFormFactory () | |
Retrieve composed form factory. | |
add ($elementOrFieldset, array $flags=[]) | |
Add an element or fieldset. | |
has ($elementOrFieldset) | |
Does the fieldset have an element/fieldset by the given name? | |
get ($elementOrFieldset) | |
Retrieve a named element or fieldset. | |
remove ($elementOrFieldset) | |
Remove a named element or fieldset. | |
setPriority ($elementOrFieldset, $priority) | |
Set/change the priority of an element or fieldset. | |
getElements () | |
Retrieve all attached elements. | |
getFieldsets () | |
Retrieve all attached fieldsets. | |
setMessages ($messages) | |
Set a hash of element names/messages to use when validation fails. | |
getMessages ($elementName=null) | |
Get validation error messages, if any. | |
prepareElement (FormInterface $form) | |
Ensures state is ready for use. | |
populateValues ($data) | |
Recursively populate values of attached elements and fieldsets. | |
count () | |
Countable: return count of attached elements/fieldsets. | |
getIterator () | |
IteratorAggregate: return internal iterator. | |
setObject ($object) | |
Set the object used by the hydrator. | |
getObject () | |
Get the object used by the hydrator. | |
setAllowedObjectBindingClass ($allowObjectBindingClass) | |
Set the class or interface of objects that can be bound to this fieldset. | |
allowedObjectBindingClass () | |
Get The class or interface of objects that can be bound to this fieldset. | |
allowObjectBinding ($object) | |
Checks if the object can be set in this fieldset. | |
setHydrator (HydratorInterface $hydrator) | |
Set the hydrator to use when binding an object to the element. | |
getHydrator () | |
Get the hydrator used when binding an object to the fieldset. | |
allowValueBinding () | |
Checks if this fieldset can bind data. | |
bindValues (array $values=[]) | |
Bind values to the bound object. | |
setUseAsBaseFieldset ($useAsBaseFieldset) | |
Set if this fieldset is used as a base fieldset. | |
useAsBaseFieldset () | |
Is this fieldset use as a base fieldset for a form ? | |
__clone () | |
Make a deep clone of a fieldset. | |
Public Member Functions inherited from Element | |
__construct ($name=null, $options=[]) | |
init () | |
This function is automatically called when creating element with factory. | |
setName ($name) | |
Set value for name. | |
getName () | |
Get value for name. | |
setOptions ($options) | |
Set options for an element. | |
getOptions () | |
Get defined options. | |
getOption ($option) | |
Return the specified option. | |
setOption ($key, $value) | |
Set a single option for an element. | |
setAttribute ($key, $value) | |
Set a single element attribute. | |
getAttribute ($key) | |
Retrieve a single element attribute. | |
removeAttribute ($key) | |
Remove a single attribute. | |
hasAttribute ($key) | |
Does the element has a specific attribute ? | |
setAttributes ($arrayOrTraversable) | |
Set many attributes at once. | |
getAttributes () | |
Retrieve all attributes at once. | |
removeAttributes (array $keys) | |
Remove many attributes at once. | |
clearAttributes () | |
Clear all attributes. | |
setValue ($value) | |
Set the element value. | |
getValue () | |
Retrieve the element value. | |
setLabel ($label) | |
Set the label used for this element. | |
getLabel () | |
Retrieve the label used for this element. | |
setLabelAttributes (array $labelAttributes) | |
Set the attributes to use with the label. | |
getLabelAttributes () | |
Get the attributes to use with the label. | |
setLabelOptions ($arrayOrTraversable) | |
Set many label options at once. | |
getLabelOptions () | |
Get label specific options. | |
clearLabelOptions () | |
Clear all label options. | |
removeLabelOptions (array $keys) | |
Remove many attributes at once. | |
setLabelOption ($key, $value) | |
Set a single label optionn. | |
getLabelOption ($key) | |
Retrieve a single label option. | |
removeLabelOption ($key) | |
Remove a single label option. | |
hasLabelOption ($key) | |
Does the element has a specific label option ? | |
setMessages ($messages) | |
Set a list of messages to report when validation fails. | |
getMessages () | |
Get validation error messages, if any. | |
Protected Member Functions | |
extract () | |
Extract values from the bound object. | |
Protected Attributes | |
$factory | |
$elements = [] | |
$fieldsets = [] | |
$messages = [] | |
$iterator | |
$hydrator | |
$object | |
$useAsBaseFieldset = false | |
$allowedObjectBindingClass | |
Protected Attributes inherited from Element | |
$attributes = [] | |
$label | |
$labelAttributes = [] | |
$labelOptions = [] | |
$messages = [] | |
$options = [] | |
$value | |
__construct | ( | $name = null , |
|
$options = [] |
|||
) |
null | int | string | $name | Optional name for the element |
array | $options | Optional options for the element |
__clone | ( | ) |
Make a deep clone of a fieldset.
add | ( | $elementOrFieldset, | |
array | $flags = [] |
||
) |
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.
array | Traversable | ElementInterface | $elementOrFieldset | |
array | $flags |
Exception\InvalidArgumentException |
Implements FieldsetInterface.
allowedObjectBindingClass | ( | ) |
Get The class or interface of objects that can be bound to this fieldset.
allowObjectBinding | ( | $object | ) |
Checks if the object can be set in this fieldset.
object | $object |
Implements FieldsetInterface.
allowValueBinding | ( | ) |
bindValues | ( | array | $values = [] | ) |
Bind values to the bound object.
array | $values |
Implements FieldsetInterface.
count | ( | ) |
Countable: return count of attached elements/fieldsets.
|
protected |
Extract values from the bound object.
get | ( | $elementOrFieldset | ) |
Retrieve a named element or fieldset.
string | $elementOrFieldset |
Implements FieldsetInterface.
getElements | ( | ) |
Retrieve all attached elements.
Storage is an implementation detail of the concrete class.
Implements FieldsetInterface.
getFieldsets | ( | ) |
Retrieve all attached fieldsets.
Storage is an implementation detail of the concrete class.
Implements FieldsetInterface.
getFormFactory | ( | ) |
getHydrator | ( | ) |
Get the hydrator used when binding an object to the fieldset.
If no hydrator is present and object implements HydratorAwareInterface, hydrator will be retrieved from the object.
Will lazy-load Hydrator if none is present.
Implements FieldsetInterface.
getIterator | ( | ) |
IteratorAggregate: return internal iterator.
getMessages | ( | $elementName = null | ) |
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.
null | string | $elementName |
Exception\InvalidArgumentException |
getObject | ( | ) |
has | ( | $elementOrFieldset | ) |
Does the fieldset have an element/fieldset by the given name?
string | $elementOrFieldset |
Implements FieldsetInterface.
populateValues | ( | $data | ) |
Recursively populate values of attached elements and fieldsets.
array | Traversable | $data |
Exception\InvalidArgumentException |
Implements FieldsetInterface.
prepareElement | ( | FormInterface | $form | ) |
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
FormInterface | $form |
Implements ElementPrepareAwareInterface.
remove | ( | $elementOrFieldset | ) |
Remove a named element or fieldset.
string | $elementOrFieldset |
Implements FieldsetInterface.
setAllowedObjectBindingClass | ( | $allowObjectBindingClass | ) |
Set the class or interface of objects that can be bound to this fieldset.
string | $allowObjectBindingClass |
setFormFactory | ( | Factory | $factory | ) |
Compose a form factory to use when calling add() with a non-element/fieldset.
Factory | $factory |
Implements FormFactoryAwareInterface.
setHydrator | ( | HydratorInterface | $hydrator | ) |
Set the hydrator to use when binding an object to the element.
HydratorInterface | $hydrator |
Implements FieldsetInterface.
setMessages | ( | $messages | ) |
Set a hash of element names/messages to use when validation fails.
array | Traversable | $messages |
Exception\InvalidArgumentException |
Implements ElementInterface.
setObject | ( | $object | ) |
Set the object used by the hydrator.
object | $object |
Exception\InvalidArgumentException |
Implements FieldsetInterface.
setOptions | ( | $options | ) |
Set options for a fieldset.
Accepted options are:
array | Traversable | $options |
Exception\InvalidArgumentException |
Implements ElementInterface.
setPriority | ( | $elementOrFieldset, | |
$priority | |||
) |
Set/change the priority of an element or fieldset.
string | $elementOrFieldset | |
int | $priority |
Implements FieldsetInterface.
setUseAsBaseFieldset | ( | $useAsBaseFieldset | ) |
useAsBaseFieldset | ( | ) |
Is this fieldset use as a base fieldset for a form ?
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |