Ejemplo n.º 1
0
 public function deleteAction()
 {
     $this->setNoRender();
     $this->disableLayout();
     $request = $this->getRequest();
     if (!$request->isPost()) {
         return;
     }
     $categoryId = $request->getPost('category_id');
     $category = Modules_Category_Services_Category::getById($categoryId);
     $condition = array('parent_id' => $categoryId);
     if (null == $category || Modules_Category_Services_Category::count($condition) > 0) {
         $this->getResponse()->setBody('RESULT_NOT_OK');
         return;
     }
     /**
      * Delete category
      */
     Modules_Category_Services_Category::delete($category);
     $this->getResponse()->setBody('RESULT_OK');
 }