Entities
4 years ago
Formatter
4 years ago
Group
4 years ago
Options
4 years ago
Value
4 years ago
Entities.php
4 years ago
Formatter.php
4 years ago
Group.php
4 years ago
MetaValuesFactory.php
4 years ago
Option.php
4 years ago
OptionGroup.php
4 years ago
Options.php
4 years ago
Paginated.php
4 years ago
Response.php
4 years ago
Value.php
4 years ago
Option.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Helper\Select; |
| 4 | |
| 5 | class Option { |
| 6 | |
| 7 | /** |
| 8 | * @var string |
| 9 | */ |
| 10 | private $value; |
| 11 | |
| 12 | /** |
| 13 | * @var string |
| 14 | */ |
| 15 | private $label; |
| 16 | |
| 17 | /** |
| 18 | * @param string $value |
| 19 | * @param string $label |
| 20 | */ |
| 21 | public function __construct( $value, $label = null ) { |
| 22 | $this->value = $value; |
| 23 | $this->label = $label ?: $value; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @return string |
| 28 | */ |
| 29 | public function get_value() { |
| 30 | return $this->value; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return string |
| 35 | */ |
| 36 | public function get_label() { |
| 37 | return $this->label; |
| 38 | } |
| 39 | |
| 40 | } |