1 | <?php |
||
20 | class HashType extends Type |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * extref converter |
||
25 | * |
||
26 | * @var ExtReferenceConverterInterface |
||
27 | */ |
||
28 | private static $extRefConverter; |
||
29 | |||
30 | /** |
||
31 | * sets the converter |
||
32 | * |
||
33 | * @param ExtReferenceConverterInterface $converter converter |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | 4 | public function setExtRefConverter(ExtReferenceConverterInterface $converter) |
|
41 | |||
42 | /** |
||
43 | * Convert DB value to PHP representation |
||
44 | * |
||
45 | * @param mixed $value Value to convert |
||
46 | * @return Hash|null |
||
47 | */ |
||
48 | 8 | public static function convertToPhp($value) |
|
52 | |||
53 | /** |
||
54 | * Convert PHP value to MongoDb representation |
||
55 | * |
||
56 | * @param mixed $value Value to convert |
||
57 | * @return object|null |
||
58 | */ |
||
59 | 8 | public static function convertToDb($value) |
|
77 | |||
78 | /** |
||
79 | * loops our structure recursively to |
||
80 | * - find all $ref objects that need to be converted either from that or to that.. |
||
81 | * - empty objects that need to be marked accordingly |
||
82 | * |
||
83 | * @param mixed $input input structure |
||
84 | * |
||
85 | * @return array altered structure with replaced $ref objects |
||
86 | */ |
||
87 | 16 | public static function processDynamicParts($input) |
|
130 | |||
131 | /** |
||
132 | * Convert to PHP value |
||
133 | * |
||
134 | * @param mixed $value Db value |
||
135 | * @return Hash|null |
||
136 | */ |
||
137 | 2 | public function convertToPHPValue($value) |
|
141 | |||
142 | /** |
||
143 | * Closure to convert to PHP value |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | 4 | public function closureToPHP() |
|
151 | |||
152 | /** |
||
153 | * Convert to DB value |
||
154 | * |
||
155 | * @param mixed $value PHP value |
||
156 | * @return object|null |
||
157 | */ |
||
158 | 2 | public function convertToDatabaseValue($value) |
|
162 | |||
163 | /** |
||
164 | * Closure to convert to DB value |
||
165 | * |
||
166 | * @return string |
||
167 | */ |
||
168 | 2 | public function closureToMongo() |
|
172 | } |
||
173 |