Eccube\Controller\Admin\Product\CategoryController::moveRank PHP Method

moveRank() public method

public moveRank ( Application $app, Request $request )
$app Eccube\Application
$request Symfony\Component\HttpFoundation\Request
    public function moveRank(Application $app, Request $request)
    {
        if ($request->isXmlHttpRequest()) {
            $ranks = $request->request->all();
            foreach ($ranks as $categoryId => $rank) {
                /* @var $Category \Eccube\Entity\Category */
                $Category = $app['eccube.repository.category']->find($categoryId);
                $Category->setRank($rank);
                $app['orm.em']->persist($Category);
            }
            $app['orm.em']->flush();
        }
        return true;
    }