Add very basic information on fieldPath mappings.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345223 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2018-06-27 16:12:43 +00:00
parent b87a886f8c
commit f2d59658fa

View file

@ -557,8 +557,18 @@ class UpperClass implements MongoDB\BSON\Persistable {
</para>
<para>
Each of those three data types can be mapped against different PHP types.
The possible mapping values are:
Besides the three collective types, it is also possible to configure
specific fields in your document to map to the data types mentioned below.
As an example, this <emphasis>fieldPath</emphasis> feature allows you to
map each <literal>"city"</literal> element of a field that stores
addresses to the <classname>City</classname> class by setting:
<literal>['addresses.$.city' => 'MyProject\City']</literal> in the typemap.
</para>
<para>
Each of those three data types, as well as the field specific mappings,
can be mapped against different PHP types. The possible mapping values
are:
</para>
<para>
@ -691,8 +701,9 @@ class UpperClass implements MongoDB\BSON\Persistable {
<classname>MongoDB\Driver\Cursor</classname> object, or the
<literal>$typeMap</literal> argument of
<function>MongoDB\BSON\toPHP</function>. Each of the three
classes (<emphasis>root</emphasis>, <emphasis>document</emphasis> and
<emphasis>array</emphasis>) can be individually set.
classes (<emphasis>root</emphasis>, <emphasis>document</emphasis>, and
<emphasis>array</emphasis>) can be individually set, in addition to the
field specific types.
</para>
<para>