Skip to content

Commit 34d492f

Browse files
committed
[docs] Revise BinData annotation and mapping documentation
1 parent 113adb3 commit 34d492f

File tree

8 files changed

+25
-27
lines changed

8 files changed

+25
-27
lines changed

docs/en/reference/annotations-reference.rst

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ For additional information on using ``@AlsoLoad``, see
4141
@Bin
4242
----
4343

44-
Alias of @Field, with "type" attribute set to
45-
"bin". Converts value to
46-
MongoBinData http://www.php.net/manual/en/class.mongobindata.php,
47-
using MongoBinData::BYTE\_ARRAY type.
44+
Alias of `@Field`_, with "type" attribute set to "bin". Converts value to
45+
`MongoBinData`_ with ``MongoBinData::GENERIC`` sub-type.
4846

4947
.. code-block:: php
5048
@@ -56,10 +54,8 @@ using MongoBinData::BYTE\_ARRAY type.
5654
@BinCustom
5755
----------
5856

59-
Alias of @Field, with "type" attribute set to
60-
"bin\_custom". Converts value to
61-
MongoBinData http://www.php.net/manual/en/class.mongobindata.php,
62-
using MongoBinData::CUSTOM type.
57+
Alias of `@Field`_, with "type" attribute set to "bin\_custom". Converts
58+
value to `MongoBinData`_ with ``MongoBinData::CUSTOM`` sub-type.
6359

6460
.. code-block:: php
6561
@@ -71,10 +67,8 @@ using MongoBinData::CUSTOM type.
7167
@BinFunc
7268
--------
7369

74-
Alias of @Field, with "type" attribute set to
75-
"bin\_func". Converts value to
76-
MongoBinData http://www.php.net/manual/en/class.mongobindata.php,
77-
using MongoBinData::FUNC type.
70+
Alias of `@Field`_, with "type" attribute set to "bin\_func". Converts value to
71+
`MongoBinData`_ with ``MongoBinData::FUNC`` sub-type.
7872

7973
.. code-block:: php
8074
@@ -86,10 +80,8 @@ using MongoBinData::FUNC type.
8680
@BinMD5
8781
-------
8882

89-
Alias of @Field, with "type" attribute set to
90-
"bin\_md5". Converts value to
91-
MongoBinData http://www.php.net/manual/en/class.mongobindata.php,
92-
using MongoBinData::MD5 type.
83+
Alias of `@Field`_, with "type" attribute set to "bin\_md5". Converts value to
84+
`MongoBinData`_ with ``MongoBinData::MD5`` sub-type.
9385

9486
.. code-block:: php
9587
@@ -101,10 +93,8 @@ using MongoBinData::MD5 type.
10193
@BinUUID
10294
--------
10395

104-
Alias of @Field, with "type" attribute set to
105-
"bin\_uuid". Converts value to
106-
MongoBinData http://www.php.net/manual/en/class.mongobindata.php,
107-
using MongoBinData::UUID type.
96+
Alias of `@Field`_, with "type" attribute set to "bin\_uuid". Converts value to
97+
`MongoBinData`_ with ``MongoBinData::UUID`` sub-type.
10898

10999
.. code-block:: php
110100
@@ -1155,3 +1145,5 @@ is used for pessimistic and optimistic locking. This is only compatible with
11551145
11561146
/** @Int @Version */
11571147
private $version;
1148+
1149+
.. _MongoBinData: http://php.net/manual/en/class.mongobindata.php

docs/en/reference/basic-mapping.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ You can read more about the available MongoDB types on `php.net <http://us.php.n
184184
Generally, the name of each built-in mapping type hints as to how the value will be converted.
185185
This list explains some of the less obvious mapping types:
186186

187-
- ``bin``: string to MongoBinData instance with a "byte array" type
187+
- ``bin``: string to MongoBinData instance with a "generic" type (default)
188188
- ``bin_bytearray``: string to MongoBinData instance with a "byte array" type
189189
- ``bin_custom``: string to MongoBinData instance with a "custom" type
190190
- ``bin_func``: string to MongoBinData instance with a "function" type

lib/Doctrine/ODM/MongoDB/Types/BinDataByteArrayType.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
namespace Doctrine\ODM\MongoDB\Types;
2121

2222
/**
23-
* The BinDataByteArray type.
23+
* The BinData type for byte array data.
24+
*
25+
* Per the BSON specification, this sub-type is deprecated in favor of the
26+
* generic sub-type (BinDataType class).
2427
*
2528
* @since 1.0
2629
* @author Jonathan H. Wage <jonwage@gmail.com>

lib/Doctrine/ODM/MongoDB/Types/BinDataCustomType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace Doctrine\ODM\MongoDB\Types;
2121

2222
/**
23-
* The BinDataCustom type.
23+
* The BinData type for custom binary data.
2424
*
2525
* @since 1.0
2626
* @author Jonathan H. Wage <jonwage@gmail.com>

lib/Doctrine/ODM/MongoDB/Types/BinDataFuncType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace Doctrine\ODM\MongoDB\Types;
2121

2222
/**
23-
* The BinDataFunc type.
23+
* The BinData type for function data.
2424
*
2525
* @since 1.0
2626
* @author Jonathan H. Wage <jonwage@gmail.com>

lib/Doctrine/ODM/MongoDB/Types/BinDataMD5Type.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
namespace Doctrine\ODM\MongoDB\Types;
2121

2222
/**
23-
* The BinDataMD5 type.
23+
* The BinData type for binary MD5 data.
24+
*
25+
* Note: This sub-type is intended to store binary MD5 data. Considering using
26+
* the basic string field type for storing hexadecimal MD5 strings.
2427
*
2528
* @since 1.0
2629
* @author Jonathan H. Wage <jonwage@gmail.com>

lib/Doctrine/ODM/MongoDB/Types/BinDataType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace Doctrine\ODM\MongoDB\Types;
2121

2222
/**
23-
* The BinData type.
23+
* The BinData type for generic data.
2424
*
2525
* @since 1.0
2626
* @author Jonathan H. Wage <jonwage@gmail.com>

lib/Doctrine/ODM/MongoDB/Types/BinDataUUIDType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
namespace Doctrine\ODM\MongoDB\Types;
2121

2222
/**
23-
* The BinDataUUID type.
23+
* The BinData type for binary UUID data.
2424
*
2525
* @since 1.0
2626
* @author Jonathan H. Wage <jonwage@gmail.com>

0 commit comments

Comments
 (0)