diff --git a/Model/Video.php b/Model/Video.php index c10b352..e8dbfb8 100644 --- a/Model/Video.php +++ b/Model/Video.php @@ -380,7 +380,7 @@ public function deleteVideo($data) { // アップロードファイル 削除 $conditions = array($this->UploadFile->alias . '.content_key' => $data['Video']['key']); - if (! $this->UploadFile->deleteAll($conditions, false)) { + if (! $this->UploadFile->deleteAll($conditions, false, true)) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); } diff --git a/Model/VideoSetting.php b/Model/VideoSetting.php index 21931ca..025caa3 100644 --- a/Model/VideoSetting.php +++ b/Model/VideoSetting.php @@ -280,7 +280,7 @@ public function deleteVideoSetting($data) { } // アップロードファイル 削除 - $this->__deleteAll($this->UploadFile, 'content_key', $contentKeys); + $this->__deleteAll($this->UploadFile, 'content_key', $contentKeys, true); // タグコンテンツ 削除 $this->__deleteAll($this->TagsContent, 'tag_id', $tagIds); @@ -344,16 +344,18 @@ private function __getContentKeys($blockIds) { * @param Model $model モデル * @param string $filed フィールド名 * @param string $value 値 + * @param bool $callBackFlag callBack実行 * @return void * @throws InternalErrorException + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ - private function __deleteAll(Model $model, $filed, $value) { + private function __deleteAll(Model $model, $filed, $value, $callBackFlag = false) { if (empty($value)) { return; } $conditions = array($model->alias . '.' . $filed => $value); - if (! $model->deleteAll($conditions, false)) { + if (! $model->deleteAll($conditions, false, $callBackFlag)) { throw new InternalErrorException(__d('net_commons', 'Internal Server Error')); } }