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
780fb6c3
Commit
780fb6c3
authored
Sep 15, 2017
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #407
parents
680c137c
a448b609
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
0 deletions
+116
-0
MongoDBGridFSBucket.txt
docs/reference/class/MongoDBGridFSBucket.txt
+2
-0
MongoDBGridFSBucket-getChunksCollection.txt
...erence/method/MongoDBGridFSBucket-getChunksCollection.txt
+29
-0
MongoDBGridFSBucket-getFilesCollection.txt
...ference/method/MongoDBGridFSBucket-getFilesCollection.txt
+29
-0
Bucket.php
src/GridFS/Bucket.php
+20
-0
CollectionWrapper.php
src/GridFS/CollectionWrapper.php
+20
-0
BucketFunctionalTest.php
tests/GridFS/BucketFunctionalTest.php
+16
-0
No files found.
docs/reference/class/MongoDBGridFSBucket.txt
View file @
780fb6c3
...
@@ -42,10 +42,12 @@ Methods
...
@@ -42,10 +42,12 @@ Methods
/reference/method/MongoDBGridFSBucket-find
/reference/method/MongoDBGridFSBucket-find
/reference/method/MongoDBGridFSBucket-findOne
/reference/method/MongoDBGridFSBucket-findOne
/reference/method/MongoDBGridFSBucket-getBucketName
/reference/method/MongoDBGridFSBucket-getBucketName
/reference/method/MongoDBGridFSBucket-getChunksCollection
/reference/method/MongoDBGridFSBucket-getChunkSizeBytes
/reference/method/MongoDBGridFSBucket-getChunkSizeBytes
/reference/method/MongoDBGridFSBucket-getDatabaseName
/reference/method/MongoDBGridFSBucket-getDatabaseName
/reference/method/MongoDBGridFSBucket-getFileDocumentForStream
/reference/method/MongoDBGridFSBucket-getFileDocumentForStream
/reference/method/MongoDBGridFSBucket-getFileIdForStream
/reference/method/MongoDBGridFSBucket-getFileIdForStream
/reference/method/MongoDBGridFSBucket-getFilesCollection
/reference/method/MongoDBGridFSBucket-getReadConcern
/reference/method/MongoDBGridFSBucket-getReadConcern
/reference/method/MongoDBGridFSBucket-getReadPreference
/reference/method/MongoDBGridFSBucket-getReadPreference
/reference/method/MongoDBGridFSBucket-getTypeMap
/reference/method/MongoDBGridFSBucket-getTypeMap
...
...
docs/reference/method/MongoDBGridFSBucket-getChunksCollection.txt
0 → 100644
View file @
780fb6c3
==============================================
MongoDB\\GridFS\\Bucket::getChunksCollection()
==============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getChunksCollection()
Returns the chunks collection used by the bucket.
.. code-block:: php
function getChunksCollection(): MongoDB\Collection
Return Values
-------------
A :phpclass:`MongoDB\\Collection` object for the chunks collection.
.. todo: add examples
docs/reference/method/MongoDBGridFSBucket-getFilesCollection.txt
0 → 100644
View file @
780fb6c3
=============================================
MongoDB\\GridFS\\Bucket::getFilesCollection()
=============================================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\GridFS\\Bucket::getFilesCollection()
Returns the files collection used by the bucket.
.. code-block:: php
function getFilesCollection(): MongoDB\Collection
Return Values
-------------
A :phpclass:`MongoDB\\Collection` object for the files collection.
.. todo: add examples
src/GridFS/Bucket.php
View file @
780fb6c3
...
@@ -278,6 +278,16 @@ class Bucket
...
@@ -278,6 +278,16 @@ class Bucket
return
$this
->
bucketName
;
return
$this
->
bucketName
;
}
}
/**
* Return the chunks collection.
*
* @return Collection
*/
public
function
getChunksCollection
()
{
return
$this
->
collectionWrapper
->
getChunksCollection
();
}
/**
/**
* Return the chunk size in bytes.
* Return the chunk size in bytes.
*
*
...
@@ -340,6 +350,16 @@ class Bucket
...
@@ -340,6 +350,16 @@ class Bucket
return
$file
->
_id
;
return
$file
->
_id
;
}
}
/**
* Return the files collection.
*
* @return Collection
*/
public
function
getFilesCollection
()
{
return
$this
->
collectionWrapper
->
getFilesCollection
();
}
/**
/**
* Return the read concern for this GridFS bucket.
* Return the read concern for this GridFS bucket.
*
*
...
...
src/GridFS/CollectionWrapper.php
View file @
780fb6c3
...
@@ -197,6 +197,16 @@ class CollectionWrapper
...
@@ -197,6 +197,16 @@ class CollectionWrapper
return
$this
->
bucketName
;
return
$this
->
bucketName
;
}
}
/**
* Return the chunks collection.
*
* @return Collection
*/
public
function
getChunksCollection
()
{
return
$this
->
chunksCollection
;
}
/**
/**
* Return the database name.
* Return the database name.
*
*
...
@@ -207,6 +217,16 @@ class CollectionWrapper
...
@@ -207,6 +217,16 @@ class CollectionWrapper
return
$this
->
databaseName
;
return
$this
->
databaseName
;
}
}
/**
* Return the files collection.
*
* @return Collection
*/
public
function
getFilesCollection
()
{
return
$this
->
filesCollection
;
}
/**
/**
* Inserts a document into the chunks collection.
* Inserts a document into the chunks collection.
*
*
...
...
tests/GridFS/BucketFunctionalTest.php
View file @
780fb6c3
...
@@ -363,6 +363,14 @@ class BucketFunctionalTest extends FunctionalTestCase
...
@@ -363,6 +363,14 @@ class BucketFunctionalTest extends FunctionalTestCase
$this
->
assertEquals
(
'fs'
,
$this
->
bucket
->
getBucketName
());
$this
->
assertEquals
(
'fs'
,
$this
->
bucket
->
getBucketName
());
}
}
public
function
testGetChunksCollection
()
{
$chunksCollection
=
$this
->
bucket
->
getChunksCollection
();
$this
->
assertInstanceOf
(
'MongoDB\Collection'
,
$chunksCollection
);
$this
->
assertEquals
(
'fs.chunks'
,
$chunksCollection
->
getCollectionName
());
}
public
function
testGetChunkSizeBytesWithCustomValue
()
public
function
testGetChunkSizeBytesWithCustomValue
()
{
{
$bucket
=
new
Bucket
(
$this
->
manager
,
$this
->
getDatabaseName
(),
[
'chunkSizeBytes'
=>
8192
]);
$bucket
=
new
Bucket
(
$this
->
manager
,
$this
->
getDatabaseName
(),
[
'chunkSizeBytes'
=>
8192
]);
...
@@ -466,6 +474,14 @@ class BucketFunctionalTest extends FunctionalTestCase
...
@@ -466,6 +474,14 @@ class BucketFunctionalTest extends FunctionalTestCase
$this
->
bucket
->
getFileIdForStream
(
$stream
);
$this
->
bucket
->
getFileIdForStream
(
$stream
);
}
}
public
function
testGetFilesCollection
()
{
$filesCollection
=
$this
->
bucket
->
getFilesCollection
();
$this
->
assertInstanceOf
(
'MongoDB\Collection'
,
$filesCollection
);
$this
->
assertEquals
(
'fs.files'
,
$filesCollection
->
getCollectionName
());
}
/**
/**
* @dataProvider provideInputDataAndExpectedChunks
* @dataProvider provideInputDataAndExpectedChunks
*/
*/
...
...
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