From bbeed47c9a2442520437cf59f4c55f556a625df9 Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy <mmedinskiy@ebay.com> Date: Fri, 27 Mar 2015 17:04:15 +0200 Subject: [PATCH] MAGETWO-35088: Page and Block Data and Repository Interfaces --- app/code/Magento/Ui/Component/Listing.php | 6 +++--- app/code/Magento/Ui/Component/Paging.php | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Ui/Component/Listing.php b/app/code/Magento/Ui/Component/Listing.php index 1cfbaa1acd6..6d8437a886c 100644 --- a/app/code/Magento/Ui/Component/Listing.php +++ b/app/code/Magento/Ui/Component/Listing.php @@ -188,7 +188,7 @@ class Listing extends AbstractView public function getCollectionItems() { $items = []; - $collection = $this->getDataCollection()->getResultCollection(); + $collection = $this->getDataCollection(); foreach ($collection->getItems() as $item) { $actualFields = []; $itemsData = $this->getDataFromDataProvider($item->getData()); @@ -230,8 +230,8 @@ class Listing extends AbstractView ); $this->renderContext->getStorage()->addGlobalData('dump', ['extenders' => []]); - $collection = $this->getDataCollection()->getResultCollection(); - $totalCount = $collection->getTotalCount(); + $collection = $this->getDataCollection(); + $totalCount = $collection->count(); $this->renderContext->getStorage()->addDataSource( $this->getName(), [ diff --git a/app/code/Magento/Ui/Component/Paging.php b/app/code/Magento/Ui/Component/Paging.php index 9a8f0a5ddd9..7c504b74ac8 100644 --- a/app/code/Magento/Ui/Component/Paging.php +++ b/app/code/Magento/Ui/Component/Paging.php @@ -37,7 +37,10 @@ class Paging extends AbstractView $offset = $this->renderContext->getRequestParam('page', $defaultPage); $defaultLimit = $this->config->getData('pageSize'); $size = $this->renderContext->getRequestParam('limit', $defaultLimit); - $this->renderContext->getStorage()->getDataCollection($this->getParentName())->setLimit($offset, $size); + $this->renderContext->getStorage() + ->getDataCollection($this->getParentName()) + ->setPageSize($size) + ->setCurPage($offset); } /** -- GitLab