mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Document MongoDB\Driver\WriteError
https://jira.mongodb.org/browse/PHPC-653 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@340584 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
cf9ca1558a
commit
697b3c9468
6 changed files with 124 additions and 42 deletions
|
@ -12,7 +12,9 @@
|
|||
<section xml:id="mongodb-driver-writeerror.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
|
||||
The <classname>MongoDB\Driver\WriteError</classname> class encapsulates
|
||||
information about a write error and may be returned as an array element from
|
||||
<methodname>MongoDB\Driver\WriteResult::getWriteErrors</methodname>.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<refentry xml:id="mongodb-driver-writeerror.getcode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>MongoDB\Driver\WriteError::getCode</refname>
|
||||
<refpurpose>Description</refpurpose>
|
||||
<refpurpose>Returns the WriteError's error code</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>ReturnType</type><methodname>MongoDB\Driver\WriteError::getCode</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>MongoDB\Driver\WriteError::getCode</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -27,15 +27,15 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
Returns the WriteError's error code.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
<simplelist>
|
||||
&mongodb.throws.argumentparsing;
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
@ -47,7 +47,17 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* ... */
|
||||
$manager = new MongoDB\Driver\Manager;
|
||||
|
||||
$bulk = new MongoDB\Driver\BulkWrite;
|
||||
$bulk->insert(['_id' => 1]);
|
||||
$bulk->insert(['_id' => 1]);
|
||||
|
||||
try {
|
||||
$manager->executeBulkWrite('db.collection', $bulk);
|
||||
} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
|
||||
var_dump($e->getWriteResult()->getWriteErrors()[0]->getCode());
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
@ -55,20 +65,12 @@
|
|||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
...
|
||||
int(11000)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<refentry xml:id="mongodb-driver-writeerror.getindex" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>MongoDB\Driver\WriteError::getIndex</refname>
|
||||
<refpurpose>Description</refpurpose>
|
||||
<refpurpose>Returns the index of the write operation corresponding to this WriteError</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>ReturnType</type><methodname>MongoDB\Driver\WriteError::getIndex</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>int</type><methodname>MongoDB\Driver\WriteError::getIndex</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -27,15 +27,17 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
Returns the index of the write operation (from
|
||||
<classname>MongoDB\Driver\BulkWrite</classname>) corresponding to this
|
||||
WriteError.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
<simplelist>
|
||||
&mongodb.throws.argumentparsing;
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
@ -47,7 +49,17 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* ... */
|
||||
$manager = new MongoDB\Driver\Manager;
|
||||
|
||||
$bulk = new MongoDB\Driver\BulkWrite;
|
||||
$bulk->insert(['_id' => 1]);
|
||||
$bulk->insert(['_id' => 1]);
|
||||
|
||||
try {
|
||||
$manager->executeBulkWrite('db.collection', $bulk);
|
||||
} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
|
||||
var_dump($e->getWriteResult()->getWriteErrors()[0]->getIndex());
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
@ -55,7 +67,7 @@
|
|||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
...
|
||||
int(1)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
@ -65,7 +77,7 @@
|
|||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member></member>
|
||||
<member><classname>MongoDB\Driver\BulkWrite</classname></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
|
|
63
reference/mongodb/mongodb/driver/writeerror/getinfo.xml
Normal file
63
reference/mongodb/mongodb/driver/writeerror/getinfo.xml
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 336263 $ -->
|
||||
|
||||
<refentry xml:id="mongodb-driver-writeerror.getinfo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>MongoDB\Driver\WriteError::getInfo</refname>
|
||||
<refpurpose>Returns additional metadata for the WriteError</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>mixed</type><methodname>MongoDB\Driver\WriteError::getInfo</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns additional metadata for the WriteError, or &null; if no metadata is
|
||||
available.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<simplelist>
|
||||
&mongodb.throws.argumentparsing;
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -4,13 +4,13 @@
|
|||
<refentry xml:id="mongodb-driver-writeerror.getmessage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>MongoDB\Driver\WriteError::getMessage</refname>
|
||||
<refpurpose>Description</refpurpose>
|
||||
<refpurpose>Returns the WriteError's error message</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>ReturnType</type><methodname>MongoDB\Driver\WriteError::getMessage</methodname>
|
||||
<modifier>final</modifier> <modifier>public</modifier> <type>string</type><methodname>MongoDB\Driver\WriteError::getMessage</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
|
@ -27,15 +27,15 @@
|
|||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
Returns the WriteError's error message.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
<simplelist>
|
||||
&mongodb.throws.argumentparsing;
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
|
||||
|
@ -47,7 +47,17 @@
|
|||
<![CDATA[
|
||||
<?php
|
||||
|
||||
/* ... */
|
||||
$manager = new MongoDB\Driver\Manager;
|
||||
|
||||
$bulk = new MongoDB\Driver\BulkWrite;
|
||||
$bulk->insert(['_id' => 1]);
|
||||
$bulk->insert(['_id' => 1]);
|
||||
|
||||
try {
|
||||
$manager->executeBulkWrite('db.collection', $bulk);
|
||||
} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
|
||||
var_dump($e->getWriteResult()->getWriteErrors()[0]->getMessage());
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
|
@ -55,20 +65,12 @@
|
|||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
...
|
||||
string(70) "E11000 duplicate key error index: db.collection.$_id_ dup key: { : 1 }"
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
<function name='mongodb\driver\writeerror' from='mongodb >=1.0.0'/>
|
||||
<function name='mongodb\driver\writeerror::getcode' from='mongodb >=1.0.0'/>
|
||||
<function name='mongodb\driver\writeerror::getindex' from='mongodb >=1.0.0'/>
|
||||
<function name='mongodb\driver\writeerror::getinfo' from='mongodb >=1.0.0'/>
|
||||
<function name='mongodb\driver\writeerror::getmessage' from='mongodb >=1.0.0'/>
|
||||
|
||||
<function name='mongodb\driver\writeresult' from='mongodb >=1.0.0'/>
|
||||
|
|
Loading…
Reference in a new issue