@@ -85,10 +85,10 @@ public function __construct(Manager $manager, $databaseName, array $options = []
85
85
* If the files collection document is not found, this method will still
86
86
* attempt to delete orphaned chunks.
87
87
*
88
- * @param ObjectId $id ObjectId of the file
88
+ * @param mixed $id File ID
89
89
* @throws FileNotFoundException
90
90
*/
91
- public function delete (ObjectId $ id )
91
+ public function delete ($ id )
92
92
{
93
93
$ file = $ this ->collectionWrapper ->findFileById ($ id );
94
94
$ this ->collectionWrapper ->deleteFileAndChunksById ($ id );
@@ -101,11 +101,11 @@ public function delete(ObjectId $id)
101
101
/**
102
102
* Writes the contents of a GridFS file to a writable stream.
103
103
*
104
- * @param ObjectId $id ObjectId of the file
104
+ * @param mixed $id File ID
105
105
* @param resource $destination Writable Stream
106
106
* @throws FileNotFoundException
107
107
*/
108
- public function downloadToStream (ObjectId $ id , $ destination )
108
+ public function downloadToStream ($ id , $ destination )
109
109
{
110
110
$ file = $ this ->collectionWrapper ->findFileById ($ id );
111
111
@@ -208,11 +208,11 @@ public function getIdFromStream($stream)
208
208
/**
209
209
* Opens a readable stream for reading a GridFS file.
210
210
*
211
- * @param ObjectId $id ObjectId of the file
211
+ * @param mixed $id File ID
212
212
* @return resource
213
213
* @throws FileNotFoundException
214
214
*/
215
- public function openDownloadStream (ObjectId $ id )
215
+ public function openDownloadStream ($ id )
216
216
{
217
217
$ file = $ this ->collectionWrapper ->findFileById ($ id );
218
218
@@ -291,11 +291,11 @@ public function openUploadStream($filename, array $options = [])
291
291
/**
292
292
* Renames the GridFS file with the specified ID.
293
293
*
294
- * @param ObjectId $id ID of the file to rename
295
- * @param string $newFilename New file name
294
+ * @param mixed $id File ID
295
+ * @param string $newFilename New file name
296
296
* @throws FileNotFoundException
297
297
*/
298
- public function rename (ObjectId $ id , $ newFilename )
298
+ public function rename ($ id , $ newFilename )
299
299
{
300
300
$ updateResult = $ this ->collectionWrapper ->updateFilenameForId ($ id , $ newFilename );
301
301
@@ -328,7 +328,7 @@ public function rename(ObjectId $id, $newFilename)
328
328
* @param string $filename File name
329
329
* @param resource $source Readable stream
330
330
* @param array $options Stream options
331
- * @return ObjectId
331
+ * @return ObjectId ID of the newly created GridFS file
332
332
* @throws InvalidArgumentException
333
333
*/
334
334
public function uploadFromStream ($ filename , $ source , array $ options = [])
0 commit comments