1 | <?php |
||
7 | class Convention implements Contracts\Convention |
||
8 | { |
||
9 | 22 | public function getType($property) |
|
20 | |||
21 | 22 | public function getTarantoolType($type) |
|
29 | |||
30 | 22 | public function isPrimitive($type) |
|
34 | |||
35 | 22 | public function encode($type, $value) |
|
36 | { |
||
37 | 22 | if (!$this->isPrimitive($type)) { |
|
38 | 3 | if ($value instanceof Contracts\Entity) { |
|
39 | 3 | return $value->getId(); |
|
40 | } |
||
41 | } |
||
42 | 22 | if ($type == 'integer') { |
|
43 | 22 | return +$value; |
|
44 | } |
||
45 | |||
46 | 22 | return $value; |
|
47 | } |
||
48 | |||
49 | 22 | public function decode($type, $value) |
|
57 | } |
||
58 |