File tree 1 file changed +12
-9
lines changed 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -81,16 +81,8 @@ public function deleteChunksByFilesId($id): void
81
81
}
82
82
83
83
/**
84
- * Deletes a GridFS file and related chunks by ID.
85
- *
86
- * @param mixed $id
84
+ * Delete all GridFS files and chunks for a given filename.
87
85
*/
88
- public function deleteFileAndChunksById ($ id ): void
89
- {
90
- $ this ->filesCollection ->deleteOne (['_id ' => $ id ]);
91
- $ this ->chunksCollection ->deleteMany (['files_id ' => $ id ]);
92
- }
93
-
94
86
public function deleteFileAndChunksByFilename (string $ filename ): int
95
87
{
96
88
/** @var iterable<array{_id: mixed}> $files */
@@ -112,6 +104,17 @@ public function deleteFileAndChunksByFilename(string $filename): int
112
104
return $ count ?? 0 ;
113
105
}
114
106
107
+ /**
108
+ * Deletes a GridFS file and related chunks by ID.
109
+ *
110
+ * @param mixed $id
111
+ */
112
+ public function deleteFileAndChunksById ($ id ): void
113
+ {
114
+ $ this ->filesCollection ->deleteOne (['_id ' => $ id ]);
115
+ $ this ->chunksCollection ->deleteMany (['files_id ' => $ id ]);
116
+ }
117
+
115
118
/**
116
119
* Drops the GridFS files and chunks collections.
117
120
*/
You can’t perform that action at this time.
0 commit comments