1 | <?php |
||
7 | class Field |
||
8 | { |
||
9 | const TEXT = 'TEXT'; |
||
10 | const NUMBER = 'NUMBER'; |
||
11 | const INT = 'INT'; |
||
12 | const DATE = 'DATE'; |
||
13 | const DATETIME = 'DATETIME'; |
||
14 | const TIME = 'TIME'; |
||
15 | |||
16 | /** @var string */ |
||
17 | private $fieldname; |
||
18 | /** @var string */ |
||
19 | private $caption; |
||
20 | /** @var string */ |
||
21 | private $type; |
||
22 | |||
23 | /** |
||
24 | * Field constructor. |
||
25 | * @param string $fieldname |
||
26 | * @param string $caption |
||
27 | * @param string $type |
||
28 | */ |
||
29 | 15 | public function __construct(string $fieldname, string $caption, string $type) |
|
38 | |||
39 | 14 | public function getFieldname() : string |
|
43 | |||
44 | 11 | public function getCaption() : string |
|
48 | |||
49 | 1 | public function getType() : string |
|
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | 3 | public function toDBAL() : string |
|
61 | |||
62 | /** |
||
63 | * @return string[] |
||
64 | */ |
||
65 | 4 | public function asArray() : array |
|
73 | |||
74 | /** |
||
75 | * @param string $type |
||
76 | * @return string |
||
77 | */ |
||
78 | 3 | public static function typeToDBAL(string $type) : string |
|
97 | } |
||
98 |