| 1 | <?php |
||
| 8 | class Field extends Dto |
||
| 9 | { |
||
| 10 | const TEXT_TYPE = 'text'; |
||
| 11 | const PHONE_TYPE = 'tel'; |
||
| 12 | const URL_TYPE = 'url'; |
||
| 13 | const CHECK_TYPE = 'checkbox'; |
||
| 14 | const RADIO_TYPE = 'radio'; |
||
| 15 | const COMBO_TYPE = 'select'; |
||
| 16 | const TEXTAREA_TYPE = 'textarea'; |
||
| 17 | const SEARCH_TYPE = 'search'; |
||
| 18 | const HIDDEN_TYPE = 'hidden'; |
||
| 19 | const NUMBER_TYPE = 'number'; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string label |
||
| 23 | */ |
||
| 24 | public $label; |
||
| 25 | /** |
||
| 26 | * @var string name |
||
| 27 | */ |
||
| 28 | public $name; |
||
| 29 | /** |
||
| 30 | * @var string type |
||
| 31 | */ |
||
| 32 | public $type = Field::TEXT_TYPE; |
||
| 33 | /** |
||
| 34 | * @var array data |
||
| 35 | */ |
||
| 36 | public $data = array(); |
||
| 37 | /** |
||
| 38 | * @var string url |
||
| 39 | */ |
||
| 40 | public $url; |
||
| 41 | /** |
||
| 42 | * @var Object value |
||
| 43 | */ |
||
| 44 | public $value; |
||
| 45 | /** |
||
| 46 | * @var bool required |
||
| 47 | */ |
||
| 48 | public $required = true; |
||
| 49 | /** |
||
| 50 | * @var string entity |
||
| 51 | */ |
||
| 52 | public $entity; |
||
| 53 | |||
| 54 | public function __construct($name, $label, $type = Field::TEXT_TYPE, $value = null, $data = array(), $url = null, $required = true) |
||
| 64 | } |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.