setManualSorting example

$product = $this->getManager()->find(Product::class$sorting['product_id']);
            if (!$product instanceof Product) {
                throw new ModelNotFoundException(Product::class$sorting['product_id']);
            }

            $sortingObj->setProduct($product);
            $sortingObj->setPosition((int) $sorting['position']);

            $collection[] = $sortingObj;
        }

        $category->setManualSorting(null);
        $this->getManager()->flush($category);
        $category->setManualSorting($collection);

        unset($data['manualSorting']);

        return $data;
    }

    /** * Returns all none association property of the category class. * * @return string[] */
if (isset($calculated[$number])) {
                $product->setCalculatedPrices($calculated[$number]);
            }
            if (isset($categories[$id])) {
                $product->setCategoryIds($categories[$id]);
            }
            if (isset($properties[$id])) {
                $product->setProperties($properties[$id]);
            }

            if (isset($manualPositions[$id])) {
                $product->setManualSorting($manualPositions[$id]);
            }

            $product->setFormattedCreatedAt(
                $this->formatDate($product->getCreatedAt())
            );
            $product->setFormattedUpdatedAt(
                $this->formatDate($product->getUpdatedAt())
            );
            $product->setFormattedReleaseDate(
                $this->formatDate($product->getReleaseDate())
            );
            
Home | Imprint | This part of the site doesn't use cookies.