public function executeInsertCategory(sfWebRequest $request) { if ($request->hasParameter("categoryid") && $request->hasParameter("categoryname")) { $parent = Doctrine_Core::getTable('Category')->findOneById($request->getParameter("categoryid")); $category = new Category(); $category->setName($request->getParameter("categoryname")); $category->setActive(true); $category->getNode()->insertAsLastChildOf($parent); return true; } }