|
7 | 7 | use MongoDB\Command; |
8 | 8 | use MongoDB\ReadPreference; |
9 | 9 | use MongoDB\WriteBatch; |
10 | | - |
11 | | -use MongoDB\QueryFlags; |
12 | | -use MongoDB\CursorType; |
13 | 10 | /* }}} */ |
14 | 11 |
|
15 | 12 | class Collection { |
16 | 13 | /* {{{ consts & vars */ |
17 | | - const INSERT = 0x01; |
18 | | - const UPDATE = 0x02; |
19 | | - const DELETE = 0x04; |
| 14 | + const QUERY_FLAG_TAILABLE_CURSOR = 0x02; |
| 15 | + const QUERY_FLAG_SLAVE_OKAY = 0x04; |
| 16 | + const QUERY_FLAG_OPLOG_REPLY = 0x08; |
| 17 | + const QUERY_FLAG_NO_CURSOR_TIMEOUT = 0x10; |
| 18 | + const QUERY_FLAG_AWAIT_DATA = 0x20; |
| 19 | + const QUERY_FLAG_EXHAUST = 0x40; |
| 20 | + const QUERY_FLAG_PARTIAL = 0x80; |
| 21 | + |
| 22 | + |
| 23 | + const CURSOR_TYPE_NON_TAILABLE = 0x00; |
| 24 | + const CURSOR_TYPE_TAILABLE = self::QUERY_FLAG_TAILABLE_CURSOR; |
| 25 | + //self::QUERY_FLAG_TAILABLE_CURSOR | self::QUERY_FLAG_AWAIT_DATA; |
| 26 | + const CURSOR_TYPE_TAILABLE_AWAIT = 0x22; |
20 | 27 |
|
21 | 28 | const FIND_ONE_AND_RETURN_BEFORE = 0x01; |
22 | 29 | const FIND_ONE_AND_RETURN_AFTER = 0x02; |
@@ -75,11 +82,12 @@ function getFindOptions() { /* {{{ */ |
75 | 82 | /** |
76 | 83 | * Indicates the type of cursor to use. This value includes both |
77 | 84 | * the tailable and awaitData options. |
78 | | - * The default is NON_TAILABLE. |
| 85 | + * The default is MongoDB\self::CURSOR_TYPE_NON_TAILABLE. |
79 | 86 | * |
| 87 | + * @see MongoDB\CursorType |
80 | 88 | * @see http://docs.mongodb.org/manual/reference/operator/meta/comment/ |
81 | 89 | */ |
82 | | - "cursorType" => CursorType\NON_TAILABLE, |
| 90 | + "cursorType" => self::CURSOR_TYPE_NON_TAILABLE, |
83 | 91 |
|
84 | 92 | /** |
85 | 93 | * The maximum number of documents to return. |
@@ -144,10 +152,10 @@ function getFindOptions() { /* {{{ */ |
144 | 152 | protected function _opQueryFlags($options) { /* {{{ */ |
145 | 153 | $flags = 0; |
146 | 154 |
|
147 | | - $flags |= $options["allowPartialResults"] ? QueryFlags\PARTIAL : 0; |
| 155 | + $flags |= $options["allowPartialResults"] ? self::QUERY_FLAG_PARTIAL : 0; |
148 | 156 | $flags |= $options["cursorType"] ? $options["cursorType"] : 0; |
149 | | - $flags |= $options["oplogReplay"] ? QueryFlags\OPLOG_REPLY: 0; |
150 | | - $flags |= $options["noCursorTimeout"] ? QueryFlags\NO_CURSOR_TIMEOUT : 0; |
| 157 | + $flags |= $options["oplogReplay"] ? self::QUERY_FLAG_OPLOG_REPLY: 0; |
| 158 | + $flags |= $options["noCursorTimeout"] ? self::QUERY_FLAG_NO_CURSOR_TIMEOUT : 0; |
151 | 159 |
|
152 | 160 | return $flags; |
153 | 161 | } /* }}} */ |
|
0 commit comments