Lines Matching refs:options

68     private $options;  variable in MongoDB\\Operation\\Find
163 * @param array $options Command options
166 public function __construct($databaseName, $collectionName, $filter, array $options = []) argument
172 if (isset($options['allowPartialResults']) && ! is_bool($options['allowPartialResults'])) {
173 …throw InvalidArgumentException::invalidType('"allowPartialResults" option', $options['allowPartial…
176 if (isset($options['batchSize']) && ! is_integer($options['batchSize'])) {
177 …throw InvalidArgumentException::invalidType('"batchSize" option', $options['batchSize'], 'integer'…
180 …if (isset($options['collation']) && ! is_array($options['collation']) && ! is_object($options['col…
181 …throw InvalidArgumentException::invalidType('"collation" option', $options['collation'], 'array or…
184 if (isset($options['comment']) && ! is_string($options['comment'])) {
185 … throw InvalidArgumentException::invalidType('"comment" option', $options['comment'], 'comment');
188 if (isset($options['cursorType'])) {
189 if (! is_integer($options['cursorType'])) {
190 …throw InvalidArgumentException::invalidType('"cursorType" option', $options['cursorType'], 'intege…
193 if ($options['cursorType'] !== self::NON_TAILABLE &&
194 $options['cursorType'] !== self::TAILABLE &&
195 $options['cursorType'] !== self::TAILABLE_AWAIT) {
196 …w new InvalidArgumentException('Invalid value for "cursorType" option: ' . $options['cursorType']);
200 …if (isset($options['hint']) && ! is_string($options['hint']) && ! is_array($options['hint']) && ! …
201 …throw InvalidArgumentException::invalidType('"hint" option', $options['hint'], 'string or array or…
204 if (isset($options['limit']) && ! is_integer($options['limit'])) {
205 … throw InvalidArgumentException::invalidType('"limit" option', $options['limit'], 'integer');
208 if (isset($options['max']) && ! is_array($options['max']) && ! is_object($options['max'])) {
209 … throw InvalidArgumentException::invalidType('"max" option', $options['max'], 'array or object');
212 if (isset($options['maxAwaitTimeMS']) && ! is_integer($options['maxAwaitTimeMS'])) {
213 …throw InvalidArgumentException::invalidType('"maxAwaitTimeMS" option', $options['maxAwaitTimeMS'],…
216 if (isset($options['maxScan']) && ! is_integer($options['maxScan'])) {
217 … throw InvalidArgumentException::invalidType('"maxScan" option', $options['maxScan'], 'integer');
220 if (isset($options['maxTimeMS']) && ! is_integer($options['maxTimeMS'])) {
221 …throw InvalidArgumentException::invalidType('"maxTimeMS" option', $options['maxTimeMS'], 'integer'…
224 if (isset($options['min']) && ! is_array($options['min']) && ! is_object($options['min'])) {
225 … throw InvalidArgumentException::invalidType('"min" option', $options['min'], 'array or object');
228 …if (isset($options['modifiers']) && ! is_array($options['modifiers']) && ! is_object($options['mod…
229 …throw InvalidArgumentException::invalidType('"modifiers" option', $options['modifiers'], 'array or…
232 if (isset($options['noCursorTimeout']) && ! is_bool($options['noCursorTimeout'])) {
233 …throw InvalidArgumentException::invalidType('"noCursorTimeout" option', $options['noCursorTimeout'…
236 if (isset($options['oplogReplay']) && ! is_bool($options['oplogReplay'])) {
237 …throw InvalidArgumentException::invalidType('"oplogReplay" option', $options['oplogReplay'], 'bool…
240 …if (isset($options['projection']) && ! is_array($options['projection']) && ! is_object($options['p…
241 …throw InvalidArgumentException::invalidType('"projection" option', $options['projection'], 'array …
244 if (isset($options['readConcern']) && ! $options['readConcern'] instanceof ReadConcern) {
245 …throw InvalidArgumentException::invalidType('"readConcern" option', $options['readConcern'], ReadC…
248 … if (isset($options['readPreference']) && ! $options['readPreference'] instanceof ReadPreference) {
249 …throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'],…
252 if (isset($options['returnKey']) && ! is_bool($options['returnKey'])) {
253 …throw InvalidArgumentException::invalidType('"returnKey" option', $options['returnKey'], 'boolean'…
256 if (isset($options['session']) && ! $options['session'] instanceof Session) {
257 …throw InvalidArgumentException::invalidType('"session" option', $options['session'], Session::clas…
260 if (isset($options['showRecordId']) && ! is_bool($options['showRecordId'])) {
261 …throw InvalidArgumentException::invalidType('"showRecordId" option', $options['showRecordId'], 'bo…
264 if (isset($options['skip']) && ! is_integer($options['skip'])) {
265 … throw InvalidArgumentException::invalidType('"skip" option', $options['skip'], 'integer');
268 if (isset($options['snapshot']) && ! is_bool($options['snapshot'])) {
269 … throw InvalidArgumentException::invalidType('"snapshot" option', $options['snapshot'], 'boolean');
272 … if (isset($options['sort']) && ! is_array($options['sort']) && ! is_object($options['sort'])) {
273 … throw InvalidArgumentException::invalidType('"sort" option', $options['sort'], 'array or object');
276 if (isset($options['typeMap']) && ! is_array($options['typeMap'])) {
277 … throw InvalidArgumentException::invalidType('"typeMap" option', $options['typeMap'], 'array');
280 if (isset($options['readConcern']) && $options['readConcern']->isDefault()) {
281 unset($options['readConcern']);
284 if (isset($options['snapshot'])) {
288 if (isset($options['maxScan'])) {
295 $this->options = $options;
309 …if (isset($this->options['collation']) && ! server_supports_feature($server, self::$wireVersionFor…
313 …if (isset($this->options['readConcern']) && ! server_supports_feature($server, self::$wireVersionF…
317 … $inTransaction = isset($this->options['session']) && $this->options['session']->isInTransaction();
318 if ($inTransaction && isset($this->options['readConcern'])) {
324 if (isset($this->options['typeMap'])) {
325 $cursor->setTypeMap($this->options['typeMap']);
343 $options = $this->createQueryOptions();
345 if (empty($options)) {
350 unset($options['maxAwaitTimeMS']);
367 if (! isset($options[$modifier[0]]) && isset($options['modifiers'][$modifier[1]])) {
368 $options[$modifier[0]] = $options['modifiers'][$modifier[1]];
371 unset($options['modifiers']);
373 return $cmd + $options;
384 $options = [];
386 if (isset($this->options['readPreference'])) {
387 $options['readPreference'] = $this->options['readPreference'];
390 if (isset($this->options['session'])) {
391 $options['session'] = $this->options['session'];
394 return $options;
407 $options = [];
409 if (isset($this->options['cursorType'])) {
410 if ($this->options['cursorType'] === self::TAILABLE) {
411 $options['tailable'] = true;
413 if ($this->options['cursorType'] === self::TAILABLE_AWAIT) {
414 $options['tailable'] = true;
415 $options['awaitData'] = true;
420 if (isset($this->options[$option])) {
421 $options[$option] = $this->options[$option];
426 if (isset($this->options[$option])) {
427 $options[$option] = (object) $this->options[$option];
431 $modifiers = empty($this->options['modifiers']) ? [] : (array) $this->options['modifiers'];
434 $options['modifiers'] = $modifiers;
437 return $options;