Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}

Expand Down
8 changes: 5 additions & 3 deletions Model/VideoSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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'));
}
}
Expand Down