1 | <?php |
||
33 | class PgEntity implements ConverterInterface |
||
34 | { |
||
35 | protected $row_structure; |
||
36 | protected $identity_mapper; |
||
37 | protected $flexible_entity_class; |
||
38 | |||
39 | |||
40 | /** |
||
41 | * Constructor. |
||
42 | * |
||
43 | * @access public |
||
44 | * @param $flexible_entity_class |
||
45 | * @param RowStructure $structure |
||
46 | * @param IdentityMapper $identity_mapper |
||
47 | */ |
||
48 | public function __construct( |
||
60 | |||
61 | /** |
||
62 | * fromPg |
||
63 | * |
||
64 | * Embeddable entities are converted here. |
||
65 | * |
||
66 | * @see ConverterInterface |
||
67 | */ |
||
68 | public function fromPg($data, $type, Session $session) |
||
92 | |||
93 | /** |
||
94 | * transformData |
||
95 | * |
||
96 | * Split data into an array prefixed with field names. |
||
97 | * |
||
98 | * @access private |
||
99 | * @param string $data |
||
100 | * @param Projection $projection |
||
101 | * @return array |
||
102 | */ |
||
103 | private function transformData($data, Projection $projection) |
||
119 | |||
120 | /** |
||
121 | * cacheEntity |
||
122 | * |
||
123 | * Check entity against the cache. |
||
124 | * |
||
125 | * @access public |
||
126 | * @param FlexibleEntityInterface $entity |
||
127 | * @return FlexibleEntityInterface |
||
128 | */ |
||
129 | public function cacheEntity(FlexibleEntityInterface $entity) |
||
136 | |||
137 | /** |
||
138 | * toPg |
||
139 | * |
||
140 | * @see ConverterInterface |
||
141 | */ |
||
142 | public function toPg($data, $type, Session $session) |
||
157 | |||
158 | /** |
||
159 | * createHydrationPlan |
||
160 | * |
||
161 | * Create a new hydration plan. |
||
162 | * |
||
163 | * @access protected |
||
164 | * @param Session $session |
||
165 | * @return HydrationPlan |
||
166 | */ |
||
167 | protected function createHydrationPlan(Session $session) |
||
174 | |||
175 | /** |
||
176 | * getFields |
||
177 | * |
||
178 | * Return the fields array. |
||
179 | * |
||
180 | * @access protected |
||
181 | * @param mixed $data |
||
182 | * @return array |
||
183 | */ |
||
184 | protected function getFields($data) |
||
195 | |||
196 | /** |
||
197 | * checkData |
||
198 | * |
||
199 | * Check if the given data is the right entity. |
||
200 | * |
||
201 | * @access protected |
||
202 | * @param mixed $data |
||
203 | * @throws ConverterException |
||
204 | * @return PgEntity $this |
||
205 | */ |
||
206 | protected function checkData($data) |
||
220 | |||
221 | /** |
||
222 | * toPgStandardFormat |
||
223 | * |
||
224 | * @see ConverterInterface |
||
225 | */ |
||
226 | public function toPgStandardFormat($data, $type, Session $session) |
||
250 | } |
||
251 |