Generic
2 days ago
Options
2 days ago
ArrayMapper.php
2 days ago
Option.php
2 days ago
OptionGroup.php
2 days ago
Options.php
2 days ago
Paginated.php
2 days ago
Response.php
2 days ago
Option.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Helper\Select; |
| 6 | |
| 7 | class Option |
| 8 | { |
| 9 | private string $value; |
| 10 | |
| 11 | private string $label; |
| 12 | |
| 13 | public function __construct(string $value, ?string $label = null) |
| 14 | { |
| 15 | $this->value = $value; |
| 16 | $this->label = $label ?? $value; |
| 17 | } |
| 18 | |
| 19 | public function get_value(): string |
| 20 | { |
| 21 | return $this->value; |
| 22 | } |
| 23 | |
| 24 | public function get_label(): string |
| 25 | { |
| 26 | return $this->label; |
| 27 | } |
| 28 | |
| 29 | } |
| 30 |