mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Use semantic tags and entities for interfaces
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342834 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
2d4a3c703f
commit
6c891e6655
10 changed files with 39 additions and 35 deletions
|
@ -324,18 +324,18 @@ foreach ($managers as $manager) {
|
|||
|
||||
<para>
|
||||
If an object is a supported class that implements
|
||||
<classname>MongoDB\BSON\Type</classname>, then use the BSON
|
||||
<interfacename>MongoDB\BSON\Type</interfacename>, then use the BSON
|
||||
serialization logic for that specific type.
|
||||
<classname>MongoDB\BSON\Type</classname> instances (excluding
|
||||
<classname>MongoDB\BSON\Serializable</classname> may only be serialized
|
||||
as a document field value. Attempting to serialize such an object as a
|
||||
root document will throw a
|
||||
<interfacename>MongoDB\BSON\Type</interfacename> instances (excluding
|
||||
<interfacename>MongoDB\BSON\Serializable</interfacename> may only be
|
||||
serialized as a document field value. Attempting to serialize such an
|
||||
object as a root document will throw a
|
||||
<classname>MongoDB\Driver\Exception\UnexpectedValueException</classname>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If an object is of an unknown class implementing the
|
||||
<classname>MongoDB\BSON\Type</classname> interface, then throw a
|
||||
<interfacename>MongoDB\BSON\Type</interfacename> interface, then throw a
|
||||
<classname>MongoDB\Driver\Exception\UnexpectedValueException</classname>
|
||||
</para>
|
||||
|
||||
|
@ -349,7 +349,7 @@ foreach ($managers as $manager) {
|
|||
|
||||
<para>
|
||||
If an object is of a class that implements the
|
||||
<classname>MongoDB\BSON\Serializable</classname> interface, call
|
||||
<interfacename>MongoDB\BSON\Serializable</interfacename> interface, call
|
||||
<methodname>MongoDB\BSON\Serializable::bsonSerialize</methodname> and use
|
||||
the returned array or <classname>stdClass</classname> to serialize as a
|
||||
BSON document or array. The BSON type will be determined by the following:
|
||||
|
@ -363,8 +363,9 @@ foreach ($managers as $manager) {
|
|||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><classname>MongoDB\BSON\Persistable</classname> objects must be
|
||||
serialized as a BSON document.
|
||||
<para>
|
||||
<interfacename>MongoDB\BSON\Persistable</interfacename> objects must be
|
||||
serialized as a BSON document.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
@ -393,9 +394,9 @@ foreach ($managers as $manager) {
|
|||
|
||||
<para>
|
||||
If an object is of a class that implements the
|
||||
<classname>MongoDB\BSON\Persistable</classname> interface (which implies
|
||||
<classname>MongoDB\BSON\Serializable</classname> obtain the properties
|
||||
in a similar way as in the previous paragraphs, but
|
||||
<interfacename>MongoDB\BSON\Persistable</interfacename> interface (which
|
||||
implies <interfacename>MongoDB\BSON\Serializable</interfacename>), obtain
|
||||
the properties in a similar way as in the previous paragraphs, but
|
||||
<emphasis>also</emphasis> add an additional property
|
||||
<property>__pclass</property> as a Binary value, with subtype
|
||||
<literal>0x80</literal> and data bearing the fully qualified class name
|
||||
|
@ -410,9 +411,9 @@ foreach ($managers as $manager) {
|
|||
the <methodname>MongoDB\BSON\Serializable::bsonSerialize</methodname>
|
||||
return value. If you want to avoid this behaviour and set your own
|
||||
<property>__pclass</property> value, you must <emphasis>not</emphasis>
|
||||
implement <classname>MongoDB\BSON\Persistable</classname> and should
|
||||
instead implement <classname>MongoDB\BSON\Serializable</classname>
|
||||
directly.
|
||||
implement <interfacename>MongoDB\BSON\Persistable</interfacename> and
|
||||
should instead implement
|
||||
<interfacename>MongoDB\BSON\Serializable</interfacename> directly.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
|
@ -586,8 +587,8 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
|||
</para>
|
||||
<para>
|
||||
If the named class implements the
|
||||
<classname>MongoDB\BSON\Persistable</classname> interface, then the
|
||||
properties of the BSON document, including the
|
||||
<interfacename>MongoDB\BSON\Persistable</interfacename> interface,
|
||||
then the properties of the BSON document, including the
|
||||
<property>__pclass</property> property, are sent as an associative
|
||||
array to the
|
||||
<methodname>MongoDB\BSON\Unserializable::bsonUnserialize</methodname>
|
||||
|
@ -595,7 +596,7 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
|||
</para>
|
||||
<para>
|
||||
If the named class does not exist or does not implement the
|
||||
<classname>MongoDB\BSON\Persistable</classname> interface,
|
||||
<interfacename>MongoDB\BSON\Persistable</interfacename> interface,
|
||||
<classname>stdClass</classname> will be used and each BSON document
|
||||
key (including <property>__pclass</property>) will be set as a
|
||||
public <classname>stdClass</classname> property.
|
||||
|
@ -644,7 +645,7 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
|||
<para>
|
||||
If the named class does not exist, is not concrete (i.e. it is
|
||||
abstract or an interface), or does not implement
|
||||
<classname>MongoDB\BSON\Unserializable</classname> then an
|
||||
<interfacename>MongoDB\BSON\Unserializable</interfacename> then an
|
||||
<classname>MongoDB\Driver\Exception\InvalidArgumentException</classname>
|
||||
exception is thrown.
|
||||
</para>
|
||||
|
@ -652,8 +653,8 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
|||
<para>
|
||||
If the BSON object has a <property>__pclass</property> property and
|
||||
that class exists and implements
|
||||
<classname>MongoDB\BSON\Persistable</classname> it will supersede the
|
||||
class provided in the type map.
|
||||
<interfacename>MongoDB\BSON\Persistable</interfacename> it will
|
||||
supersede the class provided in the type map.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@ -708,7 +709,8 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
|||
<term>YourClass</term>
|
||||
<listitem>
|
||||
<para>
|
||||
which implements <classname>MongoDB\BSON\Unserializable</classname>
|
||||
which implements
|
||||
<interfacename>MongoDB\BSON\Unserializable</interfacename>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -716,7 +718,8 @@ class UpperClass implements MongoDB\BSON\Persistable {
|
|||
<term>OurClass</term>
|
||||
<listitem>
|
||||
<para>
|
||||
which implements <classname>MongoDB\BSON\Persistable</classname>
|
||||
which implements
|
||||
<interfacename>MongoDB\BSON\Persistable</interfacename>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<!-- }}} -->
|
||||
|
||||
<section xml:id="mongodb-bson-persistable.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
&reftitle.interfacesynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<!-- }}} -->
|
||||
|
||||
<section xml:id="mongodb-bson-serializable.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
&reftitle.interfacesynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
|
|
|
@ -18,9 +18,10 @@
|
|||
<type>array</type> or <classname>stdClass</classname>.
|
||||
</para>
|
||||
<para>
|
||||
Root documents (e.g. a <classname>MongoDB\BSON\Serializable</classname>
|
||||
passed to <function>MongoDB\BSON\fromPHP</function>) will always be
|
||||
serialized as a BSON document. For field values, associative arrays and
|
||||
Root documents (e.g. a
|
||||
<interfacename>MongoDB\BSON\Serializable</interfacename> passed to
|
||||
<function>MongoDB\BSON\fromPHP</function>) will always be serialized as a
|
||||
BSON document. For field values, associative arrays and
|
||||
<classname>stdClass</classname> instances will be serialized as a BSON
|
||||
document and sequential arrays (i.e. sequential, numeric indexes starting at
|
||||
<literal>0</literal>) will be serialized as a BSON array.
|
||||
|
@ -178,7 +179,7 @@ echo MongoDB\BSON\toJSON($bson), "\n";
|
|||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>MongoDB\BSON\Unserializable::bsonUnserialize</function></member>
|
||||
<member><classname>MongoDB\BSON\Persistable</classname></member>
|
||||
<member><interfacename>MongoDB\BSON\Persistable</interfacename></member>
|
||||
<member><xref linkend="mongodb.persistence"/></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<!-- }}} -->
|
||||
|
||||
<section xml:id="mongodb-bson-type.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
&reftitle.interfacesynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<!-- }}} -->
|
||||
|
||||
<section xml:id="mongodb-bson-unserializable.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
&reftitle.interfacesynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
|
|
|
@ -98,7 +98,7 @@ object(MyDocument)#1 (1) {
|
|||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>MongoDB\BSON\Serializable::bsonSerialize</function></member>
|
||||
<member><classname>MongoDB\BSON\Persistable</classname></member>
|
||||
<member><interfacename>MongoDB\BSON\Persistable</interfacename></member>
|
||||
<member><xref linkend="mongodb.persistence"/></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
<classname>MongoDB\Driver\Exception\UnexpectedValueException</classname> if
|
||||
the PHP value cannot be converted to BSON. Possible reasons include, but are
|
||||
not limited to, encountering an unexpected
|
||||
<classname>MongoDB\BSON\Type</classname> instance or
|
||||
<interfacename>MongoDB\BSON\Type</interfacename> instance or
|
||||
<function>MongoDB\BSON\Serializable::bsonSerialize</function> failing to
|
||||
return an <type>array</type> or <classname>stdClass</classname>.
|
||||
</member>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
Throws
|
||||
<classname>MongoDB\Driver\Exception\InvalidArgumentException</classname> if
|
||||
a class in the type map cannot be instantiated or does not implement
|
||||
<classname>MongoDB\BSON\Unserializable</classname>.
|
||||
<interfacename>MongoDB\BSON\Unserializable</interfacename>.
|
||||
</member>
|
||||
<member>
|
||||
Throws
|
||||
|
|
|
@ -124,7 +124,7 @@ NULL
|
|||
<member><methodname>MongoDB\Driver\Manager::executeBulkWrite</methodname></member>
|
||||
<member><classname>MongoDB\Driver\WriteResult</classname></member>
|
||||
<member><classname>MongoDB\BSON\ObjectID</classname></member>
|
||||
<member><classname>MongoDB\BSON\Persistable</classname></member>
|
||||
<member><interfacename>MongoDB\BSON\Persistable</interfacename></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
|
|
Loading…
Reference in a new issue