Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SearchResults.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Framework\Api;
8 
13 {
14  const KEY_ITEMS = 'items';
15  const KEY_SEARCH_CRITERIA = 'search_criteria';
16  const KEY_TOTAL_COUNT = 'total_count';
17 
23  public function getItems()
24  {
25  return $this->_get(self::KEY_ITEMS) === null ? [] : $this->_get(self::KEY_ITEMS);
26  }
27 
34  public function setItems(array $items)
35  {
36  return $this->setData(self::KEY_ITEMS, $items);
37  }
38 
44  public function getSearchCriteria()
45  {
46  return $this->_get(self::KEY_SEARCH_CRITERIA);
47  }
48 
56  {
57  return $this->setData(self::KEY_SEARCH_CRITERIA, $searchCriteria);
58  }
59 
65  public function getTotalCount()
66  {
67  return $this->_get(self::KEY_TOTAL_COUNT);
68  }
69 
76  public function setTotalCount($count)
77  {
78  return $this->setData(self::KEY_TOTAL_COUNT, $count);
79  }
80 }
$count
Definition: recent.phtml:13
$searchCriteria
setSearchCriteria(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
$items