| 1 | <?php |
||
| 13 | abstract class EnumBase implements EnumInterface |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string $name |
||
| 18 | */ |
||
| 19 | protected $name = ''; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string $description |
||
| 23 | */ |
||
| 24 | protected $description = ''; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array $values |
||
| 28 | */ |
||
| 29 | protected $values = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * EnumBase constructor. |
||
| 33 | */ |
||
| 34 | public function __construct() |
||
| 38 | |||
| 39 | |||
| 40 | /** |
||
| 41 | * @return array |
||
| 42 | * @since $VID:$ |
||
| 43 | */ |
||
| 44 | abstract protected function getValues(); |
||
| 45 | |||
| 46 | |||
| 47 | /** |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | public function name() |
||
| 54 | |||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $name |
||
| 58 | */ |
||
| 59 | protected function setName($name) |
||
| 63 | |||
| 64 | |||
| 65 | /** |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | public function description() |
||
| 72 | |||
| 73 | |||
| 74 | /** |
||
| 75 | * @param string $description |
||
| 76 | */ |
||
| 77 | protected function setDescription($description) |
||
| 81 | |||
| 82 | |||
| 83 | /** |
||
| 84 | * @return aray |
||
| 85 | * @since $VID:$ |
||
| 86 | */ |
||
| 87 | public function values() |
||
| 91 | |||
| 92 | |||
| 93 | /** |
||
| 94 | * @param array $values |
||
| 95 | */ |
||
| 96 | protected function setValues(array $values) |
||
| 100 | } |
||
| 101 |