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
bbfbbd65
Commit
bbfbbd65
authored
May 01, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #531
parents
29f7cd0b
491c3b7f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
apiargs-MongoDBCollection-method-find-option.yaml
...ncludes/apiargs-MongoDBCollection-method-find-option.yaml
+1
-0
Find.php
src/Operation/Find.php
+6
-0
FindTest.php
tests/Operation/FindTest.php
+11
-0
No files found.
docs/includes/apiargs-MongoDBCollection-method-find-option.yaml
View file @
bbfbbd65
...
@@ -221,6 +221,7 @@ description: |
...
@@ -221,6 +221,7 @@ description: |
Prevents the cursor from returning a document more than once because of an
Prevents the cursor from returning a document more than once because of an
intervening write operation.
intervening write operation.
.. deprecated:: 1.4
.. versionadded:: 1.2
.. versionadded:: 1.2
interface
:
phpmethod
interface
:
phpmethod
operation
:
~
operation
:
~
...
...
src/Operation/Find.php
View file @
bbfbbd65
...
@@ -128,6 +128,8 @@ class Find implements Executable, Explainable
...
@@ -128,6 +128,8 @@ class Find implements Executable, Explainable
* * snapshot (boolean): Prevents the cursor from returning a document more
* * snapshot (boolean): Prevents the cursor from returning a document more
* than once because of an intervening write operation.
* than once because of an intervening write operation.
*
*
* This options has been deprecated since version 1.4.
*
* * sort (document): The order in which to return matching documents. If
* * sort (document): The order in which to return matching documents. If
* "$orderby" also exists in the modifiers document, this option will
* "$orderby" also exists in the modifiers document, this option will
* take precedence.
* take precedence.
...
@@ -259,6 +261,10 @@ class Find implements Executable, Explainable
...
@@ -259,6 +261,10 @@ class Find implements Executable, Explainable
unset
(
$options
[
'readConcern'
]);
unset
(
$options
[
'readConcern'
]);
}
}
if
(
isset
(
$options
[
'snapshot'
]))
{
trigger_error
(
'The "snapshot" option is deprecated and will be removed in a future release'
,
E_USER_DEPRECATED
);
}
$this
->
databaseName
=
(
string
)
$databaseName
;
$this
->
databaseName
=
(
string
)
$databaseName
;
$this
->
collectionName
=
(
string
)
$collectionName
;
$this
->
collectionName
=
(
string
)
$collectionName
;
$this
->
filter
=
$filter
;
$this
->
filter
=
$filter
;
...
...
tests/Operation/FindTest.php
View file @
bbfbbd65
...
@@ -128,6 +128,17 @@ class FindTest extends TestCase
...
@@ -128,6 +128,17 @@ class FindTest extends TestCase
return
$options
;
return
$options
;
}
}
public
function
testSnapshotOptionIsDeprecated
()
{
$this
->
assertDeprecated
(
function
()
{
new
Find
(
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'snapshot'
=>
true
]);
});
$this
->
assertDeprecated
(
function
()
{
new
Find
(
$this
->
getDatabaseName
(),
$this
->
getCollectionName
(),
[],
[
'snapshot'
=>
false
]);
});
}
private
function
getInvalidHintValues
()
private
function
getInvalidHintValues
()
{
{
return
[
123
,
3.14
,
true
];
return
[
123
,
3.14
,
true
];
...
...
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