ReadPreference constructor accepts string for mode argument

https://jira.mongodb.org/browse/PHPC-904


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342742 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jeremy Mikola 2017-07-31 19:08:13 +00:00
parent ce00c58015
commit a4bb79d4c7
2 changed files with 16 additions and 14 deletions

View file

@ -280,14 +280,6 @@ mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][
parameter. Defaults to <literal>"primary"</literal>. For
details, see <classname>MongoDB\Driver\ReadPreference</classname>.
</para>
<note>
<simpara>
This accepts a string value (e.g. <literal>"primary"</literal>,
<literal>"secondaryPreferred"</literal>), unlike
<function>MongoDB\Driver\ReadPreference::__construct</function>,
which takes an integer.
</simpara>
</note>
</entry>
</row>
<row>

View file

@ -11,7 +11,7 @@
&reftitle.description;
<methodsynopsis>
<modifier>final</modifier> <modifier>public</modifier> <methodname>MongoDB\Driver\ReadPreference::__construct</methodname>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
<methodparam><type>string|int</type><parameter>mode</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>tagSets</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
</methodsynopsis>
@ -38,7 +38,7 @@
</thead>
<tbody>
<row>
<entry><constant>MongoDB\Driver\ReadPreference::RP_PRIMARY</constant></entry>
<entry><constant>MongoDB\Driver\ReadPreference::RP_PRIMARY</constant> or <literal>"primary"</literal></entry>
<entry>
<para>
All operations read from the current replica set primary. This is
@ -47,7 +47,7 @@
</entry>
</row>
<row>
<entry><constant>MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED</constant></entry>
<entry><constant>MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED</constant> or <literal>"primaryPreferred"</literal></entry>
<entry>
<para>
In most situations, operations read from the primary but if it is
@ -56,7 +56,7 @@
</entry>
</row>
<row>
<entry><constant>MongoDB\Driver\ReadPreference::RP_SECONDARY</constant></entry>
<entry><constant>MongoDB\Driver\ReadPreference::RP_SECONDARY</constant> or <literal>"secondary"</literal></entry>
<entry>
<para>
All operations read from the secondary members of the replica set.
@ -64,7 +64,7 @@
</entry>
</row>
<row>
<entry><constant>MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED</constant></entry>
<entry><constant>MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED</constant> or <literal>"secondaryPreferred"</literal></entry>
<entry>
<para>
In most situations, operations read from secondary members but if no
@ -73,7 +73,7 @@
</entry>
</row>
<row>
<entry><constant>MongoDB\Driver\ReadPreference::RP_NEAREST</constant></entry>
<entry><constant>MongoDB\Driver\ReadPreference::RP_NEAREST</constant> or <literal>"nearest"</literal></entry>
<entry>
<para>
Operations read from member of the replica set with the least
@ -187,6 +187,16 @@
</row>
</thead>
<tbody>
<row>
<entry>1.3.0</entry>
<entry>
<para>
The <parameter>mode</parameter> argument now accepts a string value,
which is consistent with the <literal>"readPreference"</literal> URI
option for <function>MongoDB\Driver\Manager::__construct</function>.
</para>
</entry>
</row>
<row>
<entry>1.2.0</entry>
<entry>