- class Hydrator implements EntityHydratorInterface
- {
- /**
- * @param object $entity
- * @return array
- */
- public function extract($entity)
- {
- return $entity->getData();
- }
-
- /**
- * @param object $entity
- * @param array $data
- * @return object
- */
- public function hydrate($entity, array $data)
- {
- $entity->setData(array_merge($entity->getData(), $data));
- return $entity;
- }