| 1 |
<?php |
| 2 |
/** |
| 3 |
* FormElement.php |
| 4 |
* |
| 5 |
* The FormElement 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 FormElement |
| 22 |
* |
| 23 |
* @package UserAccessManager\Form |
| 24 |
*/ |
| 25 |
abstract class FormElement |
| 26 |
{ |
| 27 |
use ValueTrait; |
| 28 |
use LabelTrait; |
| 29 |
|
| 30 |
public function __construct( |
| 31 |
protected string $id, |
| 32 |
mixed $value = null, |
| 33 |
?string $label = null, |
| 34 |
protected ?string $description = null |
| 35 |
) { |
| 36 |
$this->value = $value; |
| 37 |
$this->label = $label; |
| 38 |
} |
| 39 |
|
| 40 |
public function getId(): string |
| 41 |
{ |
| 42 |
return $this->id; |
| 43 |
} |
| 44 |
|
| 45 |
public function getDescription(): ?string |
| 46 |
{ |
| 47 |
return $this->description; |
| 48 |
} |
| 49 |
} |
| 50 |
|