Пример #1
0
 /**
  * Uninstall the module.
  *
  * This function is only ever called once during the lifetime of a particular
  * module instance.
  *
  * @return bool True on success, false otherwise.
  */
 public function uninstall()
 {
     // drop table
     DoctrineHelper::dropSchema($this->entityManager, array('ExampleDoctrine_Entity_User', 'ExampleDoctrine_Entity_UserCategory', 'ExampleDoctrine_Entity_UserAttribute', 'ExampleDoctrine_Entity_UserMetadata'));
     // remove all module vars
     $this->delVars();
     // delete categories
     CategoryRegistryUtil::deleteEntry('ExampleDoctrine');
     CategoryUtil::deleteCategoriesByPath('/__SYSTEM__/Modules/ExampleDoctrine', 'path');
     // Deletion successful
     return true;
 }
Пример #2
0
 public function delete($deleteSubcats = false, $newParentID = 0)
 {
     $data = $this->_objData;
     if (!$data) {
         return $data;
     }
     if ($deleteSubcats) {
         CategoryUtil::deleteCategoriesByPath($data['ipath']);
     } elseif ($newParentID) {
         CategoryUtil::moveSubCategoriesByPath($data['ipath'], $newParentID);
         CategoryUtil::deleteCategoryByID($data['id']);
     } else {
         exit(__('Can not delete category while preserving subcategories without specifying a new parent ID'));
     }
 }
Пример #3
0
 public function delete($deleteSubcats = false, $newParentID = 0)
 {
     $objArray = $this->_objData;
     if (!$objArray) {
         return $objArray;
     }
     foreach ($objArray as $k => $obj) {
         if ($deleteSubcats) {
             CategoryUtil::deleteCategoriesByPath($obj['ipath']);
         } elseif ($newParentID) {
             CategoryUtil::moveSubCategoriesByPath($obj['ipath'], $newParentID);
             CategoryUtil::deleteCategoryByID($obj['id']);
         } else {
             exit('Can not delete category while preserving subcategories without specifying a new parent ID');
         }
     }
 }