Skip to content
Snippets Groups Projects
Commit bbeed47c authored by Maxim Medinskiy's avatar Maxim Medinskiy
Browse files

MAGETWO-35088: Page and Block Data and Repository Interfaces

parent 594b7ff2
Branches
No related merge requests found
...@@ -188,7 +188,7 @@ class Listing extends AbstractView ...@@ -188,7 +188,7 @@ class Listing extends AbstractView
public function getCollectionItems() public function getCollectionItems()
{ {
$items = []; $items = [];
$collection = $this->getDataCollection()->getResultCollection(); $collection = $this->getDataCollection();
foreach ($collection->getItems() as $item) { foreach ($collection->getItems() as $item) {
$actualFields = []; $actualFields = [];
$itemsData = $this->getDataFromDataProvider($item->getData()); $itemsData = $this->getDataFromDataProvider($item->getData());
...@@ -230,8 +230,8 @@ class Listing extends AbstractView ...@@ -230,8 +230,8 @@ class Listing extends AbstractView
); );
$this->renderContext->getStorage()->addGlobalData('dump', ['extenders' => []]); $this->renderContext->getStorage()->addGlobalData('dump', ['extenders' => []]);
$collection = $this->getDataCollection()->getResultCollection(); $collection = $this->getDataCollection();
$totalCount = $collection->getTotalCount(); $totalCount = $collection->count();
$this->renderContext->getStorage()->addDataSource( $this->renderContext->getStorage()->addDataSource(
$this->getName(), $this->getName(),
[ [
......
...@@ -37,7 +37,10 @@ class Paging extends AbstractView ...@@ -37,7 +37,10 @@ class Paging extends AbstractView
$offset = $this->renderContext->getRequestParam('page', $defaultPage); $offset = $this->renderContext->getRequestParam('page', $defaultPage);
$defaultLimit = $this->config->getData('pageSize'); $defaultLimit = $this->config->getData('pageSize');
$size = $this->renderContext->getRequestParam('limit', $defaultLimit); $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);
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment