DynamicBucket.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Search\Request\Aggregation;
  7. use Magento\Framework\Search\Request\BucketInterface;
  8. /**
  9. * Dynamic Buckets
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class DynamicBucket implements BucketInterface
  14. {
  15. /**
  16. * @var string
  17. */
  18. protected $name;
  19. /**
  20. * @var string
  21. */
  22. protected $field;
  23. /**
  24. * @var array
  25. */
  26. protected $method;
  27. /**
  28. * @param string $name
  29. * @param string $field
  30. * @param string $method
  31. * @codeCoverageIgnore
  32. */
  33. public function __construct($name, $field, $method)
  34. {
  35. $this->name = $name;
  36. $this->field = $field;
  37. $this->method = $method;
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function getType()
  43. {
  44. return BucketInterface::TYPE_DYNAMIC;
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. public function getName()
  50. {
  51. return $this->name;
  52. }
  53. /**
  54. * {@inheritdoc}
  55. * @codeCoverageIgnore
  56. */
  57. public function getField()
  58. {
  59. return $this->field;
  60. }
  61. /**
  62. * Get method
  63. *
  64. * @return string
  65. * @codeCoverageIgnore
  66. */
  67. public function getMethod()
  68. {
  69. return $this->method;
  70. }
  71. /**
  72. * {@inheritdoc}
  73. * @codeCoverageIgnore
  74. */
  75. public function getMetrics()
  76. {
  77. return [];
  78. }
  79. }