Get the derive files of current file with the File type
public getRawDerives ( ) : Illuminate\Database\Eloquent\Collection | static[] | ||
return | Illuminate\Database\Eloquent\Collection | static[] |
/** * remove file * * @param File $file file instance * @return bool */ public function remove(File $file) { // 파일이 원본일 경우 동적으로 생성된 파일 모두 삭제 처리 함 if ($file->originId === null) { foreach ($file->getRawDerives() as $child) { $this->remove($child); } } $file->getConnection()->table($file->getFileableTable())->where('fileId', $file->id)->delete(); $this->files->delete($file); return $file->delete(); }
/** * remove file * * @param File $file file instance * @return bool */ public function remove(File $file) { // 파일이 원본일 경우 동적으로 생성된 파일 모두 삭제 처리 함 if ($file->originId === null) { foreach ($file->getRawDerives() as $child) { $this->remove($child); } } $this->files->delete($file); return $file->delete(); }