Commit edb5dd6f authored by Will Banfield's avatar Will Banfield Committed by Jeremy Mikola

PHPLIB-149: implement find on files collection

parent 3269ce9f
...@@ -128,12 +128,6 @@ class Bucket ...@@ -128,12 +128,6 @@ class Bucket
} }
} }
public function find($filter, array $options =[])
{
//add proper validation for the filter and for the options
return $this->filesCollection->find($filter);
}
private function ensureIndexes() private function ensureIndexes()
{ {
if ($this->ensuredIndexes) { if ($this->ensuredIndexes) {
......
...@@ -112,5 +112,14 @@ class BucketReadWriter ...@@ -112,5 +112,14 @@ class BucketReadWriter
$gridFsStream = new GridFsDownload($this->bucket, null, $file); $gridFsStream = new GridFsDownload($this->bucket, null, $file);
$gridFsStream->downloadToStream($destination); $gridFsStream->downloadToStream($destination);
} }
/**
* Find files from the GridFS bucket files collection.
*
* @param array $filter filter to find by
* @param array $options options to
*/
public function find($filter, array $options =[])
{
return $this->bucket->getFilesCollection()->find($filter, $options);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment