3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
12 interface ElementInterface
15 * Set the name of this element
17 * In most cases, this will proxy to the attributes for storage, but is
18 * present to indicate that elements are generally named.
21 * @return ElementInterface
23 public function setName($name);
26 * Retrieve the element name
30 public function getName();
33 * Set options for an element
35 * @param array|\Traversable $options
36 * @return ElementInterface
38 public function setOptions($options);
41 * get the defined options
45 public function getOptions();
48 * return the specified option
50 * @param string $option
53 public function getOption($option);
56 * Set a single element attribute
60 * @return ElementInterface
62 public function setAttribute($key, $value);
65 * Retrieve a single element attribute
70 public function getAttribute($key);
73 * Return true if a specific attribute is set
78 public function hasAttribute($key);
81 * Set many attributes at once
83 * Implementation will decide if this will overwrite or merge.
85 * @param array|\Traversable $arrayOrTraversable
86 * @return ElementInterface
88 public function setAttributes($arrayOrTraversable);
91 * Retrieve all attributes at once
93 * @return array|\Traversable
95 public function getAttributes();
98 * Set the value of the element
100 * @param mixed $value
101 * @return ElementInterface
103 public function setValue($value);
106 * Retrieve the element value
110 public function getValue();
113 * Set the label (if any) used for this element
116 * @return ElementInterface
118 public function setLabel($label);
121 * Retrieve the label (if any) used for this element
125 public function getLabel();
128 * Set a list of messages to report when validation fails
130 * @param array|\Traversable $messages
131 * @return ElementInterface
133 public function setMessages($messages);
136 * Get validation error messages, if any
138 * Returns a list of validation failure messages, if any.
140 * @return array|\Traversable
142 public function getMessages();