Пример #1
0
 protected function beforeDelete()
 {
     // Удалить всех подписчиков
     $items = subscribe_model_Subscriber::find(array(array('subscribe', $this->_data['id'])));
     if (!empty($items)) {
         foreach ($items as $itemRow) {
             $itemRow->delete();
         }
     }
     return parent::beforeDelete();
 }
Пример #2
0
 protected function beforeDelete()
 {
     // Удалить все файлы и изображения
     if (cot_module_active('files')) {
         $files = files_model_File::find(array(array('file_source', 'advboard'), array('file_item', $this->_data['id'])));
         if (!empty($files)) {
             foreach ($files as $fileRow) {
                 $fileRow->delete();
             }
         }
     }
     // Удалить все комментарии к этому отзыву
     if (cot_plugin_active('comments')) {
         cot_comments_remove('advboard', $this->_data['id']);
     }
     return parent::beforeDelete();
 }