| 1 | <?php |
||
| 11 | class Number extends NamedElement |
||
| 12 | { |
||
| 13 | protected $type = 'number'; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * the maximum allowed value |
||
| 17 | * |
||
| 18 | * @var int |
||
| 19 | */ |
||
| 20 | protected $max; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * the minimum allowed value |
||
| 24 | * |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | protected $min; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * incremental step |
||
| 31 | * |
||
| 32 | * @var int |
||
| 33 | */ |
||
| 34 | protected $step = 1; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return string|int |
||
| 38 | */ |
||
| 39 | public function getMax() |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | protected function getDefaultMax() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param int $value |
||
| 58 | * @return $this |
||
| 59 | */ |
||
| 60 | public function setMax(int $value) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return int |
||
| 71 | */ |
||
| 72 | public function getMin() |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return string |
||
| 83 | */ |
||
| 84 | protected function getDefaultMin() |
||
| 88 | |||
| 89 | /** |
||
| 90 | * @param int $value |
||
| 91 | * @return $this |
||
| 92 | */ |
||
| 93 | public function setMin(int $value) |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @return int |
||
| 104 | */ |
||
| 105 | public function getStep() |
||
| 109 | |||
| 110 | /** |
||
| 111 | * @param int $value |
||
| 112 | * @return $this |
||
| 113 | */ |
||
| 114 | public function setStep(int $value) |
||
| 120 | |||
| 121 | protected function getDefaultValidationRules() |
||
| 127 | |||
| 128 | public function toArray() |
||
| 136 | } |
||
| 137 |