| 1 | <?php |
||
| 8 | class Rule implements \JsonSerializable{ |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $type; |
||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | private $prompt; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $value; |
||
| 22 | |||
| 23 | public function __construct($type,$prompt=NULL,$value=NULL){ |
||
| 28 | |||
| 29 | public function getType() { |
||
| 32 | |||
| 33 | public function setType($type) { |
||
| 37 | |||
| 38 | public function getPrompt() { |
||
| 41 | |||
| 42 | public function setPrompt($prompt) { |
||
| 46 | |||
| 47 | public function getValue() { |
||
| 50 | |||
| 51 | public function setValue($value) { |
||
| 55 | |||
| 56 | public function jsonSerialize() { |
||
| 64 | |||
| 65 | public static function match($name,$prompt=null){ |
||
| 68 | |||
| 69 | public static function integer($min=0,$max=100,$prompt=null){ |
||
| 72 | |||
| 73 | public static function decimal($prompt=null){ |
||
| 76 | |||
| 77 | public static function number($prompt=null){ |
||
| 80 | |||
| 81 | } |