Elcodi\Admin\ProductBundle\Services\CategorySorter::sort PHP Method

sort() public method

The order is received on the following format: [ [ 'id' => xx, 'subtree' => [ 'id' => xx, 'subtree' => [] ] ], [ 'id' => xx, 'subtree' => [ [ 'id' => xx, 'subtree' => [ 'id' => xx, 'subtree' => [] ] ] ] ], ]
public sort ( array $categoriesOrder ) : boolean
$categoriesOrder array The category order (See function comment)
return boolean If the order process has finished right.
    public function sort(array $categoriesOrder)
    {
        if ($this->sortCategoriesTree($categoriesOrder)) {
            $this->categoryObjectManager->flush();
            return true;
        }
        return false;
    }