/** * Append products sorted by the user to the category. * * @param CategoryInterface $category Category. * * @return $this */ private function setSortedProducts(CategoryInterface $category) { $productPositions = $this->getRequest()->getParam('product_position', []); $category->setSortedProductIds(array_keys($productPositions)); return $this; }