/** * * @access protected * @param \CCDNForum\ForumBundle\Entity\Category $category */ protected function onSuccess(Category $category) { $this->dispatcher->dispatch(ForumEvents::ADMIN_CATEGORY_DELETE_SUCCESS, new AdminCategoryEvent($this->request, $category)); if (!$this->form->get('confirm_subordinates')->getData()) { $boards = new ArrayCollection($category->getBoards()->toArray()); $this->categoryModel->reassignBoardsToCategory($boards, null)->flush(); } $this->categoryModel->deleteCategory($category); $this->dispatcher->dispatch(ForumEvents::ADMIN_CATEGORY_DELETE_COMPLETE, new AdminCategoryEvent($this->request, $category)); }
/** * * @access protected * @param \CCDNForum\ForumBundle\Entity\Category $category */ protected function onSuccess(Category $category) { $this->dispatcher->dispatch(ForumEvents::ADMIN_CATEGORY_EDIT_SUCCESS, new AdminCategoryEvent($this->request, $category)); $this->categoryModel->updateCategory($category); $this->dispatcher->dispatch(ForumEvents::ADMIN_CATEGORY_EDIT_COMPLETE, new AdminCategoryEvent($this->request, $category)); }