Skip to content

Commit

Permalink
fix bug in File Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
ziaratban committed Feb 11, 2020
1 parent 97cccff commit 80f5ae1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/file/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,31 +128,30 @@ public function getFileCollection($refresh = false)
'name' => $this->name
]);
}

return $this->_fileCollection;
}

/**
* {@inheritdoc}
*/
public function drop()
public function drop($execOptions = [])
{
return parent::drop() && $this->database->dropCollection($this->getChunkCollection()->name);
return parent::drop($execOptions) && $this->database->dropCollection($this->getChunkCollection()->name,$execOptions);
}

/**
* {@inheritdoc}
* @return Cursor cursor for the search results
*/
public function find($condition = [], $fields = [], $options = [])
public function find($condition = [], $fields = [], $options = [], $execOptions = [])
{
return new Cursor($this, parent::find($condition, $fields, $options));
return new Cursor($this, parent::find($condition, $fields, $options, $execOptions));
}

/**
* {@inheritdoc}
*/
public function remove($condition = [], $options = [])
public function remove($condition = [], $options = [], $execOptions = [])
{
$fileCollection = $this->getFileCollection();
$chunkCollection = $this->getChunkCollection();
Expand All @@ -166,7 +165,7 @@ public function remove($condition = [], $options = [])

$batchSize = 200;
$options['batchSize'] = $batchSize;
$cursor = $fileCollection->find($condition, ['_id'], $options);
$cursor = $fileCollection->find($condition, ['_id'], $options, $execOptions);
unset($options['limit']);
$deleteCount = 0;
$deleteCallback = function ($ids) use ($fileCollection, $chunkCollection, $options) {
Expand Down

0 comments on commit 80f5ae1

Please sign in to comment.