forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadPreference.php
129 lines (109 loc) · 3.64 KB
/
ReadPreference.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
namespace MongoDB\Driver;
use MongoDB\BSON\Serializable;
use MongoDB\Driver\Exception\InvalidArgumentException;
use MongoDB\Driver\Exception\UnexpectedValueException;
/**
* Class ReadPreference
* @link https://php.net/manual/en/class.mongodb-driver-readpreference.php
*/
final class ReadPreference implements Serializable, \Serializable
{
public const RP_PRIMARY = 1;
public const RP_PRIMARY_PREFERRED = 5;
public const RP_SECONDARY = 2;
public const RP_SECONDARY_PREFERRED = 6;
public const RP_NEAREST = 10;
/**
* @since 1.7.0
*/
public const PRIMARY = 'primary';
/**
* @since 1.7.0
*/
public const PRIMARY_PREFERRED = 'primaryPreferred';
/**
* @since 1.7.0
*/
public const SECONDARY = 'secondary';
/**
* @since 1.7.0
*/
public const SECONDARY_PREFERRED = 'secondaryPreferred';
/**
* @since 1.7.0
*/
public const NEAREST = 'nearest';
/**
* @since 1.2.0
*/
public const NO_MAX_STALENESS = -1;
/**
* @since 1.2.0
*/
public const SMALLEST_MAX_STALENESS_SECONDS = 90;
/**
* Construct immutable ReadPreference
* @link https://php.net/manual/en/mongodb-driver-readpreference.construct.php
* @param string|int $mode
* @param array|null $tagSets
* @param array $options
* @throws InvalidArgumentException if mode is invalid or if tagSets is provided for a primary read preference.
*/
final public function __construct($mode, ?array $tagSets = null, ?array $options = []) {}
public static function __set_state(array $properties) {}
/**
* Returns the ReadPreference's "hedge" option
* @since 1.8.0
* @link https://www.php.net/manual/en/mongodb-driver-readpreference.gethedge.php
* @return object|null
*/
final public function getHedge() {}
/**
* Returns the ReadPreference's "mode" option
* @link https://php.net/manual/en/mongodb-driver-readpreference.getmode.php
* @return int
*/
final public function getMode() {}
/**
* Returns the ReadPreference's "mode" option as a string
* @since 1.7.0
* @link https://php.net/manual/en/mongodb-driver-readpreference.getmodestring.php
* @return string
* @throws InvalidArgumentException
*/
final public function getModeString() {}
/**
* Returns the ReadPreference's "tagSets" option
* @link https://php.net/manual/en/mongodb-driver-readpreference.gettagsets.php
* @return array
*/
final public function getTagSets() {}
/**
* Returns an object for BSON serialization
* @since 1.2.0
* @link https://www.php.net/manual/en/mongodb-driver-readpreference.bsonserialize.php
* @return object Returns an object for serializing the WriteConcern as BSON.
* @throws InvalidArgumentException
*/
final public function bsonSerialize() {}
/**
* Serialize a ReadPreference
* @since 1.7.0
* @link https://php.net/manual/en/mongodb-driver-readpreference.serialize.php
* @return string
* @throws InvalidArgumentException
*/
final public function serialize() {}
/**
* Unserialize a ReadPreference
* @since 1.7.0
* @link https://php.net/manual/en/mongodb-driver-readpreference.unserialize.php
* @param string $serialized
* @return void
* @throws InvalidArgumentException on argument parsing errors or if the properties are invalid
* @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed)
*/
final public function unserialize($serialized) {}
final public function getMaxStalenessSeconds() {}
}