From ec6cb30f0e84618fb4a79d2d58d14126a8a071ba Mon Sep 17 00:00:00 2001
From: Hannes Magnusson <bjori@php.net>
Date: Wed, 28 Nov 2012 20:33:41 +0000
Subject: [PATCH] Make the role=errors section consistent for all write methods

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@328545 c90b9560-bf6c-de11-be94-00142212c4b1
---
 language-snippets.ent                           |  1 +
 reference/mongo/mongocollection/batchinsert.xml | 10 +---------
 reference/mongo/mongocollection/ensureindex.xml | 11 +----------
 reference/mongo/mongocollection/insert.xml      | 11 +----------
 reference/mongo/mongocollection/remove.xml      | 11 +----------
 reference/mongo/mongocollection/save.xml        | 11 +----------
 reference/mongo/mongocollection/update.xml      | 11 +----------
 reference/mongo/mongogridfs/storebytes.xml      |  5 +----
 reference/mongo/mongogridfs/storefile.xml       |  5 +----
 9 files changed, 9 insertions(+), 67 deletions(-)

diff --git a/language-snippets.ent b/language-snippets.ent
index 04e32eaaa2..2e6e36de0a 100644
--- a/language-snippets.ent
+++ b/language-snippets.ent
@@ -1725,3 +1725,4 @@ on replica set members.</para></listitem></varlistentry></variablelist>
 <!ENTITY mongo.writes.parameters.fsync '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"fsync"</literal></para><para>Boolean, defaults to &false;. Forces the insert to be synced to disk before returning success. If &true;, an acknowledged insert is implied and will override setting <literal>w</literal> to <literal>0</literal>.</para></listitem>'>
 <!ENTITY mongo.writes.parameters.timeout '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"timeout"</literal></para><para>Integer, defaults to <literal>MongoCursor::$timeout</literal>.  If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response.  If the database does not respond within the timeout period, a <classname>MongoCursorTimeoutException</classname> will be thrown.</para></listitem>'>
 <!ENTITY mongo.writes.parameters.safe '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"safe"</literal></para><para><emphasis>Deprecated</emphasis>. Please use the <link linkend="mongo.writeconcerns">WriteConcern</link> <literal>w</literal> option.</para></listitem>'>
+<!ENTITY mongo.errors.exceptions.writeconcern '<para>Throws <classname>MongoCursorException</classname> if the "w" option is set and the write fails.</para><para>Throws <classname>MongoCursorTimeoutException</classname> if the "w" option is set to a value greater than one and the operation takes longer than <varname>MongoCursor::$timeout</varname> milliseconds to complete.  This does not kill the operation on the server, it is a client-side timeout. The operation in <literal>MongoCollection::$wtimeout</literal> is milliseconds.</para>'>
diff --git a/reference/mongo/mongocollection/batchinsert.xml b/reference/mongo/mongocollection/batchinsert.xml
index c1b3b21b29..0d4cbac853 100644
--- a/reference/mongo/mongocollection/batchinsert.xml
+++ b/reference/mongo/mongocollection/batchinsert.xml
@@ -76,15 +76,7 @@
 
  <refsect1 role="errors">
   &reftitle.errors;
-  <para>
-   Throws <classname>MongoCursorException</classname> if the "w" option is 
-   set and the insert fails.
-  </para>
-  <para>
-   Throws <classname>MongoCursorTimeoutException</classname> if the "w" 
-   option is set to a value greater than one and the database cannot replicate 
-   the operation in <literal>MongoCollection::$wtimeout</literal> milliseconds.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
  <refsect1 role="changelog">
diff --git a/reference/mongo/mongocollection/ensureindex.xml b/reference/mongo/mongocollection/ensureindex.xml
index 72f6ff992d..dcdc7cdeaa 100644
--- a/reference/mongo/mongocollection/ensureindex.xml
+++ b/reference/mongo/mongocollection/ensureindex.xml
@@ -215,16 +215,7 @@
    Throws <classname>MongoException</classname> if the index name is longer than
    128 bytes. (Version 1.0.11+)
   </para>
-  <para>
-   Throws <classname>MongoCursorException</classname> if the "w" option is 
-   set and the index creation fails.
-  </para>
-  <para>
-   Throws <classname>MongoCursorTimeoutException</classname> if the "w" 
-   option is set and the operation takes longer than 
-   <varname>MongoCursor::$timeout</varname> milliseconds to complete.  This does
-   not kill the operation on the server, it is a client-side timeout.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
  <refsect1 role="examples">
diff --git a/reference/mongo/mongocollection/insert.xml b/reference/mongo/mongocollection/insert.xml
index 2fd95130ed..e42141e455 100644
--- a/reference/mongo/mongocollection/insert.xml
+++ b/reference/mongo/mongocollection/insert.xml
@@ -189,16 +189,7 @@
   <para>
    Throws <classname>MongoException</classname> if the inserted array is empty.
   </para>
-  <para>
-   Throws <classname>MongoCursorException</classname> if the
-   <literal>"w"</literal> option is set and the operation fails.
-  </para>
-  <para>
-   Throws <classname>MongoCursorTimeoutException</classname> if the
-   <literal>"w"</literal> option is set and the operation takes longer than 
-   <varname>MongoCursor::$timeout</varname> milliseconds to complete. This does
-   not kill the operation on the server; it is a client-side timeout.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
  <refsect1 role="changelog">
diff --git a/reference/mongo/mongocollection/remove.xml b/reference/mongo/mongocollection/remove.xml
index 46f56dbc5c..1468eff7db 100644
--- a/reference/mongo/mongocollection/remove.xml
+++ b/reference/mongo/mongocollection/remove.xml
@@ -72,16 +72,7 @@
 
  <refsect1 role="errors">
   &reftitle.errors;
-  <para>
-   Throws <classname>MongoCursorException</classname> if the
-   <literal>"w"</literal> option is set and the operation fails.
-  </para>
-  <para>
-   Throws <classname>MongoCursorTimeoutException</classname> if the
-   <literal>"w"</literal> option is set and the operation takes longer than 
-   <varname>MongoCursor::$timeout</varname> milliseconds to complete. This does
-   not kill the operation on the server; it is a client-side timeout.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
  <refsect1 role="changelog">
diff --git a/reference/mongo/mongocollection/save.xml b/reference/mongo/mongocollection/save.xml
index ebd80bd9a9..06a12ef273 100644
--- a/reference/mongo/mongocollection/save.xml
+++ b/reference/mongo/mongocollection/save.xml
@@ -65,16 +65,7 @@
 
  <refsect1 role="errors">
   &reftitle.errors;
-  <para>
-   Throws <classname>MongoCursorException</classname> if the "w" option is 
-   set and the save fails.
-  </para>
-  <para>
-   Throws <classname>MongoCursorTimeoutException</classname> if the "w" 
-   option is set and the operation takes longer than 
-   <varname>MongoCursor::$timeout</varname> milliseconds to complete.  This does
-   not kill the operation on the server, it is a client-side timeout.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
  <refsect1 role="changelog">
diff --git a/reference/mongo/mongocollection/update.xml b/reference/mongo/mongocollection/update.xml
index e58538e928..702262170b 100644
--- a/reference/mongo/mongocollection/update.xml
+++ b/reference/mongo/mongocollection/update.xml
@@ -109,16 +109,7 @@
 
  <refsect1 role="errors">
   &reftitle.errors;
-  <para>
-   Throws <classname>MongoCursorException</classname> if the
-   <literal>"w"</literal> option is set and the operation fails.
-  </para>
-  <para>
-   Throws <classname>MongoCursorTimeoutException</classname> if the
-   <literal>"w"</literal> option is set and the operation takes longer than 
-   <varname>MongoCursor::$timeout</varname> milliseconds to complete. This does
-   not kill the operation on the server; it is a client-side timeout.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
  <refsect1 role="changelog">
diff --git a/reference/mongo/mongogridfs/storebytes.xml b/reference/mongo/mongogridfs/storebytes.xml
index edb3a4afb8..9f31cded98 100644
--- a/reference/mongo/mongogridfs/storebytes.xml
+++ b/reference/mongo/mongogridfs/storebytes.xml
@@ -67,10 +67,7 @@
 
  <refsect1 role="errors">
   &reftitle.errors;
-  <para>
-   Throws <classname>MongoCursorException</classname> if the "w" option is 
-   set and the insert fails.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
 </refentry>
diff --git a/reference/mongo/mongogridfs/storefile.xml b/reference/mongo/mongogridfs/storefile.xml
index 143702bea3..2a0d38c34a 100644
--- a/reference/mongo/mongogridfs/storefile.xml
+++ b/reference/mongo/mongogridfs/storefile.xml
@@ -67,10 +67,7 @@
 
  <refsect1 role="errors">
   &reftitle.errors;
-  <para>
-   Throws <classname>MongoCursorException</classname> if the "w" option is 
-   set and the insert fails.
-  </para>
+  &mongo.errors.exceptions.writeconcern;
  </refsect1>
 
 </refentry>