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
114d8f58
Commit
114d8f58
authored
Dec 10, 2014
by
Hannes Magnusson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move constants from namespace constants to class constants
parent
541588fd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
35 deletions
+19
-35
Collection.php
src/Collection.php
+19
-11
CursorType.php
src/CursorType.php
+0
-12
QueryFlags.php
src/QueryFlags.php
+0
-12
No files found.
src/Collection.php
View file @
114d8f58
...
@@ -7,16 +7,23 @@ use MongoDB\Query;
...
@@ -7,16 +7,23 @@ use MongoDB\Query;
use
MongoDB\Command
;
use
MongoDB\Command
;
use
MongoDB\ReadPreference
;
use
MongoDB\ReadPreference
;
use
MongoDB\WriteBatch
;
use
MongoDB\WriteBatch
;
use
MongoDB\QueryFlags
;
use
MongoDB\CursorType
;
/* }}} */
/* }}} */
class
Collection
{
class
Collection
{
/* {{{ consts & vars */
/* {{{ consts & vars */
const
INSERT
=
0x01
;
const
QUERY_FLAG_TAILABLE_CURSOR
=
0x02
;
const
UPDATE
=
0x02
;
const
QUERY_FLAG_SLAVE_OKAY
=
0x04
;
const
DELETE
=
0x04
;
const
QUERY_FLAG_OPLOG_REPLY
=
0x08
;
const
QUERY_FLAG_NO_CURSOR_TIMEOUT
=
0x10
;
const
QUERY_FLAG_AWAIT_DATA
=
0x20
;
const
QUERY_FLAG_EXHAUST
=
0x40
;
const
QUERY_FLAG_PARTIAL
=
0x80
;
const
CURSOR_TYPE_NON_TAILABLE
=
0x00
;
const
CURSOR_TYPE_TAILABLE
=
self
::
QUERY_FLAG_TAILABLE_CURSOR
;
//self::QUERY_FLAG_TAILABLE_CURSOR | self::QUERY_FLAG_AWAIT_DATA;
const
CURSOR_TYPE_TAILABLE_AWAIT
=
0x22
;
const
FIND_ONE_AND_RETURN_BEFORE
=
0x01
;
const
FIND_ONE_AND_RETURN_BEFORE
=
0x01
;
const
FIND_ONE_AND_RETURN_AFTER
=
0x02
;
const
FIND_ONE_AND_RETURN_AFTER
=
0x02
;
...
@@ -75,11 +82,12 @@ class Collection {
...
@@ -75,11 +82,12 @@ class Collection {
/**
/**
* Indicates the type of cursor to use. This value includes both
* Indicates the type of cursor to use. This value includes both
* the tailable and awaitData options.
* the tailable and awaitData options.
* The default is NON_TAILABLE.
* The default is
MongoDB\self::CURSOR_TYPE_
NON_TAILABLE.
*
*
* @see MongoDB\CursorType
* @see http://docs.mongodb.org/manual/reference/operator/meta/comment/
* @see http://docs.mongodb.org/manual/reference/operator/meta/comment/
*/
*/
"cursorType"
=>
CursorType\
NON_TAILABLE
,
"cursorType"
=>
self
::
CURSOR_TYPE_
NON_TAILABLE
,
/**
/**
* The maximum number of documents to return.
* The maximum number of documents to return.
...
@@ -144,10 +152,10 @@ class Collection {
...
@@ -144,10 +152,10 @@ class Collection {
protected
function
_opQueryFlags
(
$options
)
{
/* {{{ */
protected
function
_opQueryFlags
(
$options
)
{
/* {{{ */
$flags
=
0
;
$flags
=
0
;
$flags
|=
$options
[
"allowPartialResults"
]
?
QueryFlags\
PARTIAL
:
0
;
$flags
|=
$options
[
"allowPartialResults"
]
?
self
::
QUERY_FLAG_
PARTIAL
:
0
;
$flags
|=
$options
[
"cursorType"
]
?
$options
[
"cursorType"
]
:
0
;
$flags
|=
$options
[
"cursorType"
]
?
$options
[
"cursorType"
]
:
0
;
$flags
|=
$options
[
"oplogReplay"
]
?
QueryFlags\
OPLOG_REPLY
:
0
;
$flags
|=
$options
[
"oplogReplay"
]
?
self
::
QUERY_FLAG_
OPLOG_REPLY
:
0
;
$flags
|=
$options
[
"noCursorTimeout"
]
?
QueryFlags\
NO_CURSOR_TIMEOUT
:
0
;
$flags
|=
$options
[
"noCursorTimeout"
]
?
self
::
QUERY_FLAG_
NO_CURSOR_TIMEOUT
:
0
;
return
$flags
;
return
$flags
;
}
/* }}} */
}
/* }}} */
...
...
src/CursorType.php
deleted
100644 → 0
View file @
541588fd
<?php
namespace
MongoDB\CursorType
;
const
NON_TAILABLE
=
0x00
;
//const TAILABLE = \MongoDB\QueryFlags\TAILABLE_CURSOR;
const
TAILABLE
=
0x02
;
//const TAILABLE_AWAIT = \MongoDB\QueryFlags\TAILABLE_CURSOR | \MongoDB\QueryFlags\AWAIT_DATA;
const
TAILABLE_AWAIT
=
0x22
;
src/QueryFlags.php
deleted
100644 → 0
View file @
541588fd
<?php
namespace
MongoDB\QueryFlags
;
const
TAILABLE_CURSOR
=
0x02
;
const
SLAVE_OKAY
=
0x04
;
const
OPLOG_REPLY
=
0x08
;
const
NO_CURSOR_TIMEOUT
=
0x10
;
const
AWAIT_DATA
=
0x20
;
const
EXHAUST
=
0x40
;
const
PARTIAL
=
0x80
;
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