public function onPostSetData(FormEvent $event)
 {
     $category = $event->getData();
     $category->setParentMultilangue($this->parentCategory);
     $category->setParent($this->selectCategoryParent($this->parentCategory->getParent(), $category->getLocale()));
 }
 /**
  * {@inheritDoc}
  */
 public function getParent()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getParent', array());
     return parent::getParent();
 }
 /**
  * @Route("/category/down/{slug}", name="admin_category_down")
  * @Method("GET")
  * @Security("has_role('ROLE_ADMIN')")
  * @ParamConverter("category", options={"mapping": {"slug": "slug"}})
  */
 public function categoryDownAction(Request $request, Category $category)
 {
     $entityManager = $this->getDoctrine()->getManager();
     $repo = $entityManager->getRepository('AppBundle\\Entity\\Category');
     if ($category->getParent()) {
         $repo->moveDown($category);
         $repo->verify();
         $repo->recover();
         $entityManager->flush();
     }
     return $this->redirectToRoute('admin_categories');
 }