JoinProcessorInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Api\ExtensionAttribute;
  7. use Magento\Framework\Data\Collection\AbstractDb as DbCollection;
  8. /**
  9. * Join processor allows to join extension attributes during collections loading.
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface JoinProcessorInterface
  15. {
  16. /**
  17. * Processes extension attributes join instructions to add necessary joins to the collection of extensible entities.
  18. *
  19. * @param DbCollection $collection
  20. * @param string|null $extensibleEntityClass
  21. * @return void
  22. * @throws \LogicException
  23. */
  24. public function process(DbCollection $collection, $extensibleEntityClass = null);
  25. /**
  26. * Extract extension attributes into separate extension object.
  27. *
  28. * Complex extension attributes will be populated using flat data loaded.
  29. * Data items used for extension object population are unset from the $data.
  30. *
  31. * @param string $extensibleEntityClass
  32. * @param array $data
  33. * @return array
  34. * @throws \LogicException
  35. */
  36. public function extractExtensionAttributes($extensibleEntityClass, array $data);
  37. }