1 | <?php |
||
16 | abstract class AbstractForm implements FormInterface, Iterator |
||
17 | { |
||
18 | /** @var FormElement[] */ |
||
19 | protected $form; |
||
20 | |||
21 | /** |
||
22 | * FormInterface constructor. Creates <FORM> element automatically. |
||
23 | * |
||
24 | * @param string $name |
||
25 | * @param string $action |
||
26 | * @param string $method |
||
27 | */ |
||
28 | public function __construct($name, $action = '', $method = 'POST') |
||
39 | |||
40 | /** |
||
41 | * Initialize form. |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | abstract protected function initForm(); |
||
46 | |||
47 | /** |
||
48 | * Adds a form element to the form. |
||
49 | * |
||
50 | * @param FormElement $formElement |
||
51 | * @return AbstractForm |
||
52 | */ |
||
53 | protected function addChildNode(FormElement $formElement) |
||
61 | |||
62 | /** |
||
63 | * Gets the form elements. |
||
64 | * |
||
65 | * @return FormElement[]; |
||
|
|||
66 | */ |
||
67 | public function getChildNodes() |
||
71 | |||
72 | /** |
||
73 | * Validates the form. |
||
74 | * |
||
75 | * @return boolean |
||
76 | */ |
||
77 | public function isValid() |
||
85 | |||
86 | /** |
||
87 | * Sets form data. |
||
88 | * |
||
89 | * @param array $data |
||
90 | * @return FormInterface |
||
91 | */ |
||
92 | public function setData(array $data) |
||
98 | |||
99 | /** |
||
100 | * Returns the form data. |
||
101 | * |
||
102 | * @return array |
||
103 | */ |
||
104 | public function getData() |
||
109 | |||
110 | /** |
||
111 | * Return the current element. |
||
112 | * |
||
113 | * @return FormElement |
||
114 | */ |
||
115 | final public function current() |
||
119 | |||
120 | /** |
||
121 | * Moves the pointer forward to next element. |
||
122 | * |
||
123 | * @return void |
||
124 | */ |
||
125 | final public function next() |
||
129 | |||
130 | /** |
||
131 | * Returns the key of the current element. |
||
132 | * |
||
133 | * @return mixed |
||
134 | */ |
||
135 | final public function key() |
||
139 | |||
140 | /** |
||
141 | * Checks if current position is valid. |
||
142 | * |
||
143 | * @return boolean |
||
144 | */ |
||
145 | final public function valid() |
||
151 | |||
152 | /** |
||
153 | * Rewinds the Iterator to the first element. |
||
154 | * |
||
155 | * @return void |
||
156 | */ |
||
157 | final public function rewind() |
||
161 | } |
||
162 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.