_type = $this->validatePropertyValue('_type', $sourceArray['type']); } if (!empty($sourceArray['items'])) { $factory = new ReceiptResponseFactory(); $itemsObj = []; foreach ($sourceArray['items'] as $item) { if ($receipt = $factory->factory($item)) { $itemsObj[] = $receipt; } } $this->_items = $this->validatePropertyValue('_items', $itemsObj); } if (!empty($sourceArray['next_cursor'])) { $this->_next_cursor = $this->validatePropertyValue('_next_cursor', $sourceArray['next_cursor']); } } /** * Возвращает список чеков. * * @return AbstractReceiptResponse[]|ListObjectInterface Список чеков */ public function getItems(): ListObjectInterface { if($this->_items === null) { $this->_items = new ListObject(AbstractReceiptResponse::class); } return $this->_items; } }