SearchResult.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Api\Search;
  7. use Magento\Framework\Api\AbstractSimpleObject;
  8. use Magento\Framework\Api\SearchCriteriaInterface as BaseSearchCriteriaInterface;
  9. use Magento\Framework\Api\Search\SearchCriteriaInterface;
  10. use Magento\Framework\Api\Search\SearchResultInterface;
  11. class SearchResult extends AbstractSimpleObject implements SearchResultInterface
  12. {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function getAggregations()
  17. {
  18. return $this->_get(self::AGGREGATIONS);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function setAggregations($aggregations)
  24. {
  25. return $this->setData(self::AGGREGATIONS, $aggregations);
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getItems()
  31. {
  32. return $this->_get(self::ITEMS);
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function setItems(array $items = null)
  38. {
  39. return $this->setData(self::ITEMS, $items);
  40. }
  41. /**
  42. * Get search criteria.
  43. *
  44. * @return SearchCriteriaInterface
  45. */
  46. public function getSearchCriteria()
  47. {
  48. return $this->_get(self::SEARCH_CRITERIA);
  49. }
  50. /**
  51. * Set search criteria.
  52. *
  53. * @param BaseSearchCriteriaInterface $searchCriteria
  54. * @return $this
  55. */
  56. public function setSearchCriteria(BaseSearchCriteriaInterface $searchCriteria = null)
  57. {
  58. return $this->setData(self::SEARCH_CRITERIA, $searchCriteria);
  59. }
  60. /**
  61. * Get total count.
  62. *
  63. * @return int
  64. */
  65. public function getTotalCount()
  66. {
  67. return $this->_get(self::TOTAL_COUNT);
  68. }
  69. /**
  70. * Set total count.
  71. *
  72. * @param int $totalCount
  73. * @return $this
  74. */
  75. public function setTotalCount($totalCount)
  76. {
  77. return $this->setData(self::TOTAL_COUNT, $totalCount);
  78. }
  79. }