Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
0bb64620
Commit
0bb64620
authored
Aug 07, 2016
by
Andreas Braun
Committed by
Jeremy Mikola
Sep 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add accessor for gridFS buckets in database class
parent
0195906b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
Database.php
src/Database.php
+21
-0
No files found.
src/Database.php
View file @
0bb64620
...
@@ -9,6 +9,7 @@ use MongoDB\Driver\ReadConcern;
...
@@ -9,6 +9,7 @@ use MongoDB\Driver\ReadConcern;
use
MongoDB\Driver\ReadPreference
;
use
MongoDB\Driver\ReadPreference
;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Exception\InvalidArgumentException
;
use
MongoDB\Exception\InvalidArgumentException
;
use
MongoDB\GridFS\Bucket
;
use
MongoDB\Model\CollectionInfoIterator
;
use
MongoDB\Model\CollectionInfoIterator
;
use
MongoDB\Operation\CreateCollection
;
use
MongoDB\Operation\CreateCollection
;
use
MongoDB\Operation\DatabaseCommand
;
use
MongoDB\Operation\DatabaseCommand
;
...
@@ -262,6 +263,26 @@ class Database
...
@@ -262,6 +263,26 @@ class Database
return
new
Collection
(
$this
->
manager
,
$this
->
databaseName
,
$collectionName
,
$options
);
return
new
Collection
(
$this
->
manager
,
$this
->
databaseName
,
$collectionName
,
$options
);
}
}
/**
* Select a GridFS bucket within this database.
*
* @see Bucket::__construct() for supported options
* @param string $bucketName Name of the bucket to select (defaults to 'fs')
* @param array $options Bucket constructor options
* @return Bucket
*/
public
function
selectGridFSBucket
(
$bucketName
=
'fs'
,
array
$options
=
[])
{
$options
+=
[
'bucketName'
=>
$bucketName
,
'readConcern'
=>
$this
->
readConcern
,
'readPreference'
=>
$this
->
readPreference
,
'writeConcern'
=>
$this
->
writeConcern
,
];
return
new
Bucket
(
$this
->
manager
,
$this
->
databaseName
,
$options
);
}
/**
/**
* Get a clone of this database with different options.
* Get a clone of this database with different options.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment