saveProductPositions() public method

Save the product postions.
public saveProductPositions ( Magento\Catalog\Api\Data\CategoryInterface $category ) : Position
$category Magento\Catalog\Api\Data\CategoryInterface Saved category.
return Position
 /**
  * Resource model save function plugin.
  * Append a commit callback to save the product positions.
  *
  * @param \Magento\Catalog\Model\ResourceModel\Category $categoryResource Category original resource model.
  * @param \Closure                                      $proceed          Original save method.
  * @param \Magento\Framework\Model\AbstractModel        $category         Saved category.
  *
  * @return \Magento\Catalog\Model\ResourceModel\Category
  */
 public function aroundSave(\Magento\Catalog\Model\ResourceModel\Category $categoryResource, \Closure $proceed, \Magento\Framework\Model\AbstractModel $category)
 {
     if ($category->getId() && $category->getSortedProducts()) {
         $this->unserializeProductPositions($category);
         if ($category->getIsVirtualCategory()) {
             $category->setPostedProducts([]);
         }
         $categoryResource->addCommitCallback(function () use($category) {
             $affectedProductIds = $this->getAffectedProductIds($category);
             $category->setAffectedProductIds($affectedProductIds);
             $this->saveHandler->saveProductPositions($category);
         });
     }
     return $proceed($category);
 }