Method | Description | |
---|---|---|
__construct ( Elcodi\Component\Product\Repository\CategoryRepository $categoryRepository, Doctrine\Common\Persistence\ObjectManager $categoryObjectManager, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) | Builds a new category order service. | |
sort ( array $categoriesOrder ) : boolean | Sort the received categories based on the received order. |
Method | Description | |
---|---|---|
sortCategoriesTree ( array $categoriesOrder, Elcodi\Component\Product\Entity\Category | null $parentCategory = null ) : boolean | Sort a category tree based on the received order recursively. |
public __construct ( Elcodi\Component\Product\Repository\CategoryRepository $categoryRepository, Doctrine\Common\Persistence\ObjectManager $categoryObjectManager, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) | ||
$categoryRepository | Elcodi\Component\Product\Repository\CategoryRepository | The category repository |
$categoryObjectManager | Doctrine\Common\Persistence\ObjectManager | The category object manager |
$eventDispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface | An event dispatcher instance |
protected sortCategoriesTree ( array $categoriesOrder, Elcodi\Component\Product\Entity\Category | null $parentCategory = null ) : boolean | ||
$categoriesOrder | array | The category order |
$parentCategory | Elcodi\Component\Product\Entity\Category | null | The parent category in case is not a root category. |
return | boolean | If the order process has finished right. |