Source of file ShopifyCollectionController.php
Size: 0,894 Bytes - Last Modified: 2021-12-24T06:46:30+00:00
/var/www/docs.ssmods.com/process/src/src/Controller/ShopifyCollectionController.php
12345678910111213141516171819202122232425262728293031 | <?php namespace Dynamic\Shopify\Page; use SilverStripe\Control\HTTPRequest; use SilverStripe\ORM\PaginatedList; class ShopifyCollectionController extends \PageController { /** * @param HTTPRequest|null $request * @return PaginatedList */ public function ProductPaginatedList(HTTPRequest $request = null) { if (!$request instanceof HTTPRequest) { $request = $this->getRequest(); } $products = $this->data()->getProductList(); $start = ($request->getVar('start')) ? (int)$request->getVar('start') : 0; $records = PaginatedList::create($products, $request); $records->setPageStart($start); $records->setPageLength($this->data()->ProductsPerPage); // allow $records to be updated via extension $this->extend('updateProductPaginatedList', $records); return $records; } } |