1 | <?php |
||
26 | class RecordFieldValue extends Model |
||
27 | { |
||
28 | const TYPE_BINARY = 'binary'; |
||
29 | const TYPE_STRING = 'string'; |
||
30 | const TYPE_DOUBLE = 'double'; |
||
31 | /** |
||
32 | * Array elements. For each item, you must explicitly specify the type. |
||
33 | */ |
||
34 | const TYPE_LIST = 'list'; |
||
35 | /** |
||
36 | * Date and time in UTC. |
||
37 | */ |
||
38 | const TYPE_DATETIME = 'datetime'; |
||
39 | const TYPE_INTEGER = 'integer'; |
||
40 | const TYPE_BOOLEAN = 'boolean'; |
||
41 | /** |
||
42 | * Is NaN value (floating point number). |
||
43 | */ |
||
44 | const TYPE_NAN = 'nan'; |
||
45 | /** |
||
46 | * Is the value of negative infinity. |
||
47 | */ |
||
48 | const TYPE_NINF = 'ninf'; |
||
49 | /** |
||
50 | * Is the value of infinity. |
||
51 | */ |
||
52 | const TYPE_INF = 'inf'; |
||
53 | /** |
||
54 | * Is NULL. |
||
55 | */ |
||
56 | const TYPE_NULL = 'null'; |
||
57 | |||
58 | protected $value; |
||
59 | |||
60 | protected $type; |
||
61 | |||
62 | /** |
||
63 | * Get array from object |
||
64 | * |
||
65 | * @param array|object $data |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | 7 | protected function toArrayRecursive($data) |
|
90 | |||
91 | /** |
||
92 | * Set from array |
||
93 | * |
||
94 | * @param array $data |
||
95 | * |
||
96 | * @return $this |
||
97 | */ |
||
98 | 9 | public function fromArray($data) |
|
111 | |||
112 | /** |
||
113 | * @return string |
||
114 | * @throws EmptyRecordFieldValueTypeException |
||
115 | */ |
||
116 | 9 | public function getType() |
|
145 | |||
146 | /** |
||
147 | * @param string $type |
||
148 | */ |
||
149 | 5 | public function setType($type) |
|
153 | |||
154 | /** |
||
155 | * @return mixed|$this[] |
||
156 | */ |
||
157 | 6 | public function getValue() |
|
161 | |||
162 | /** |
||
163 | * @param mixed $value |
||
164 | */ |
||
165 | 9 | public function setValue($value) |
|
169 | } |
||
170 |