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
664b5454
Commit
664b5454
authored
Dec 08, 2014
by
Hannes Magnusson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
folding
parent
bb17999f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Collection.php
src/MongoDB/Collection.php
+11
-5
No files found.
src/MongoDB/Collection.php
View file @
664b5454
<?php
namespace
MongoDB
;
/* phongo includes */
/*
{{{
phongo includes */
use
MongoDB\Manager
;
use
MongoDB\Query
;
use
MongoDB\Command
;
...
...
@@ -10,8 +10,10 @@ use MongoDB\WriteBatch;
use
MongoDB\QueryFlags
;
use
MongoDB\CursorType
;
/* }}} */
class
Collection
{
/* {{{ consts & vars */
const
INSERT
=
0x01
;
const
UPDATE
=
0x02
;
const
DELETE
=
0x04
;
...
...
@@ -23,13 +25,16 @@ class Collection {
protected
$dbname
;
protected
$collname
;
function
__construct
(
Manager
$manager
,
$ns
,
WriteConcern
$wc
=
null
,
ReadPreference
$rp
=
null
)
{
/* }}} */
function
__construct
(
Manager
$manager
,
$ns
,
WriteConcern
$wc
=
null
,
ReadPreference
$rp
=
null
)
{
/* {{{ */
$this
->
manager
=
$manager
;
$this
->
ns
=
$ns
;
$this
->
wc
=
$wc
;
$this
->
rp
=
$rp
;
list
(
$this
->
dbname
,
$this
->
collname
)
=
explode
(
"."
,
$ns
,
2
);
}
}
/* }}} */
function
find
(
array
$filter
=
array
(),
array
$options
=
array
())
{
/* {{{ {{{ */
$options
=
array_merge
(
$this
->
getFindOptions
(),
$options
);
...
...
@@ -350,14 +355,15 @@ class Collection {
/* FIXME: Add a version check for useCursor */
return
$opts
;
}
/* }}} */
protected
function
_massageAggregateOptions
(
$options
)
{
protected
function
_massageAggregateOptions
(
$options
)
{
/* {{{ */
if
(
$options
[
"useCursor"
])
{
$options
[
"cursor"
]
=
array
(
"batchSize"
=>
$options
[
"batchSize"
]);
}
unset
(
$options
[
"useCursor"
],
$options
[
"batchSize"
]);
return
$options
;
}
}
/* }}} */
protected
function
_generateCommandException
(
$doc
)
{
/* {{{ */
if
(
$doc
[
"errmsg"
])
{
...
...
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