HydratorInterface.php 549 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\EntityManager;
  7. /**
  8. * Interface HydratorInterface
  9. */
  10. interface HydratorInterface
  11. {
  12. /**
  13. * Extract data from object
  14. *
  15. * @param object $entity
  16. * @return array
  17. */
  18. public function extract($entity);
  19. /**
  20. * Populate entity with data
  21. *
  22. * @param object $entity
  23. * @param array $data
  24. * @return object
  25. */
  26. public function hydrate($entity, array $data);
  27. }