| 1 |
<?php |
| 2 |
/** |
| 3 |
* Form.php |
| 4 |
* |
| 5 |
* The Form class file. |
| 6 |
* |
| 7 |
* PHP versions 5 |
| 8 |
* |
| 9 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 10 |
* @copyright 2008-2017 Alexander Schneider |
| 11 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 12 |
* @version SVN: $id$ |
| 13 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 14 |
*/ |
| 15 |
|
| 16 |
declare(strict_types=1); |
| 17 |
|
| 18 |
namespace UserAccessManager\Form; |
| 19 |
|
| 20 |
/** |
| 21 |
* Class Form |
| 22 |
* |
| 23 |
* @package UserAccessManager\Form |
| 24 |
*/ |
| 25 |
class Form |
| 26 |
{ |
| 27 |
/** |
| 28 |
* @var FormElement[] |
| 29 |
*/ |
| 30 |
private $elements = []; |
| 31 |
|
| 32 |
/** |
| 33 |
* @param FormElement $element |
| 34 |
*/ |
| 35 |
public function addElement(FormElement $element) |
| 36 |
{ |
| 37 |
$this->elements[$element->getId()] = $element; |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* @return FormElement[] |
| 42 |
*/ |
| 43 |
public function getElements(): array |
| 44 |
{ |
| 45 |
return $this->elements; |
| 46 |
} |
| 47 |
} |
| 48 |
|