DataProviderInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Search\Dynamic;
  7. use Magento\Framework\DB\Ddl\Table;
  8. use Magento\Framework\Search\Dynamic\EntityStorage;
  9. use Magento\Framework\Search\Request\BucketInterface;
  10. /**
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface DataProviderInterface
  15. {
  16. /**
  17. * Get range
  18. *
  19. * @return int
  20. */
  21. public function getRange();
  22. /**
  23. * @param EntityStorage $entityStorage
  24. * @return array
  25. */
  26. public function getAggregations(EntityStorage $entityStorage);
  27. /**
  28. * @param BucketInterface $bucket
  29. * @param array $dimensions
  30. * @param EntityStorage $entityStorage
  31. * @return IntervalInterface
  32. */
  33. public function getInterval(
  34. BucketInterface $bucket,
  35. array $dimensions,
  36. EntityStorage $entityStorage
  37. );
  38. /**
  39. * @param BucketInterface $bucket
  40. * @param array $dimensions
  41. * @param int $range
  42. * @param EntityStorage $entityStorage
  43. * @return array
  44. */
  45. public function getAggregation(
  46. BucketInterface $bucket,
  47. array $dimensions,
  48. $range,
  49. EntityStorage $entityStorage
  50. );
  51. /**
  52. * @param int $range
  53. * @param array $dbRanges
  54. * @return array
  55. */
  56. public function prepareData($range, array $dbRanges);
  57. }