public function destroy($catalogId)
 {
     if (!$this->isPostRequest()) {
         exit;
     }
     try {
         $catalog = CatalogModel::getInstance()->getById($catalogId);
         if (empty($catalog)) {
             PhException::throwErrors(['Catalog_IdNotFound' => 1]);
         }
         FileUtil::deleteDir(ProductModel::getInstance()->getImagesDir($catalogId));
         if (CatalogModel::getInstance()->imageExist($catalogId)) {
             CatalogModel::getInstance()->deleteImage($catalogId);
         }
         ProductModel::getInstance()->deleteProductsTable($catalogId);
         CatalogModel::getInstance()->delete($catalogId);
         messages::add('Catalog_Deleted', ['name' => $catalog['name']], 'success');
         $this->systemRedirect('/catalog');
     } catch (PhException $e) {
         messages::addGroup('error', $e->getErrors());
         $this->systemRedirect('/catalog');
     }
 }