/**
  * Ajax Data
  */
 public function generateCategoriesFullPathAction()
 {
     $categories = new Catalog_Model_Mapper_Categories();
     $freePathCategories = $categories->fetchFreeRowColumn('full_path');
     foreach ($freePathCategories as $category) {
         $id = $category->id;
         $fullPath = $categories->generateFullPath($id);
         $category->fullPath = $fullPath;
         //if($this->_validateColumn($category->fullPath, 'categories', 'full_path')){
         $mapper = new Catalog_Model_Mapper_Categories();
         $mapper->save($category);
         //}
     }
     $this->view->entries = $categories->fetchFreeRowColumn('full_path');
 }
 public function disabledAction()
 {
     $categoryId = $this->_request->getParam('id');
     if (is_null($categoryId)) {
         $this->_redirector->gotoSimpleAndExit('index');
     }
     $category = $this->_modelMapper->find($categoryId, new Catalog_Model_Categories());
     if (is_null($category)) {
         throw new Zend_Controller_Action_Exception("Страница не найдена", 404);
     }
     if ($this->_request->isPost()) {
         $url = $this->_request->getParam('currentUrl');
         $enabled = $category->getActive() != 0 ? 0 : 1;
         $category->setActive($enabled);
         $this->_modelMapper->save($category);
         $this->clearCache('CatalogCategories');
         $this->_redirector->gotoUrlAndExit($url);
     }
 }