data = $data; } /** * Retrieves a value from the data array if set, or null otherwise. * * @param string $key * @return mixed|null */ private function getData($key) { return isset($this->data[$key]) ? $this->data[$key] : null; } /** * Set value for the given key * * @param string $key * @param mixed $value * @return $this */ private function setData($key, $value) { $this->data[$key] = $value; return $this; } /** * Get items * * @return \Magento\Framework\Api\AbstractExtensibleObject[] */ public function getItems() { return $this->getData(self::KEY_ITEMS) === null ? [] : $this->getData(self::KEY_ITEMS); } /** * Set items * * @param \Magento\Framework\Api\AbstractExtensibleObject[] $items * @return $this */ public function setItems(array $items) { return $this->setData(self::KEY_ITEMS, $items); } /** * Get search criteria * * @return \Magento\Framework\Api\SearchCriteria */ public function getSearchCriteria() { return $this->getData(self::KEY_SEARCH_CRITERIA); } /** * Set search criteria * * @param SearchCriteriaInterface $searchCriteria * @return $this */ public function setSearchCriteria(SearchCriteriaInterface $searchCriteria) { return $this->setData(self::KEY_SEARCH_CRITERIA, $searchCriteria); } /** * Get total count * * @return int */ public function getTotalCount() { return $this->getData(self::KEY_TOTAL_COUNT); } /** * Set total count * * @param int $count * @return $this */ public function setTotalCount($count) { return $this->setData(self::KEY_TOTAL_COUNT, $count); } }