Skip to content
Browse files

Merge pull request #80 from doctrine/improve-uuid-mapping

improve documentation about uuid and change @String to @Field
  • Loading branch information...
2 parents a87d0ae + 898fc18 commit 01f0b078e1396c996b175e6189487e195e253efd @lsmith77 lsmith77 committed Mar 2, 2016
View
8 en/cookbook/last-modified.rst
@@ -23,16 +23,16 @@ you can get timestamps on your documents by simply adding the mixins:
*/
class SomeDocument
{
- /** @Date(property="jcr:created") */
+ /** @Field(type="date", property="jcr:created") */
private $created;
- /** @String(property="jcr:createdBy") */
+ /** @Field(type="string", property="jcr:createdBy") */
private $createdBy;
- /** @Date(property="jcr:lastModified") */
+ /** @Field(type="date", property="jcr:lastModified") */
private $lastModified;
- /** @String(property="jcr:lastModifiedBy") */
+ /** @Field(type="string", property="jcr:lastModifiedBy") */
private $lastModifiedBy;
}
View
12 en/reference/annotations-mapping.rst
@@ -433,7 +433,7 @@ event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
.. _annref_postpersist:
@PostPersist
-~~~~~~~~~~~~~~
+~~~~~~~~~~~~
Life cycle callback. The marked method will be called automatically on the ``postPersist``
event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
@@ -452,7 +452,7 @@ event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
.. _annref_postremove:
@PostRemove
-~~~~~~~~~~~~~
+~~~~~~~~~~~
Life cycle callback. The marked method will be called automatically on the ``postRemove``
event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
@@ -471,7 +471,7 @@ event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
.. _annref_postupdate:
@PostUpdate
-~~~~~~~~~~~~~
+~~~~~~~~~~~
Life cycle callback. The marked method will be called automatically on the ``postUpdate``
event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
@@ -509,7 +509,7 @@ event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
.. _annref_preremove:
@PreRemove
-~~~~~~~~~~~~
+~~~~~~~~~~
Life cycle callback. The marked method will be called automatically on the ``preRemove``
event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
@@ -528,7 +528,7 @@ event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
.. _annref_preupdate:
@PreUpdate
-~~~~~~~~~~~~
+~~~~~~~~~~
Life cycle callback. The marked method will be called automatically on the ``preUpdate``
event. See :ref:`lifecycle callbacks <events_lifecyclecallbacks>`
@@ -666,7 +666,7 @@ Example:
protected $locale;
/**
- * @String(translated=true)
+ * @Field(type="string", translated=true)
*/
protected $title;
}
View
20 en/reference/basic-mapping.rst
@@ -120,7 +120,7 @@ A Doctrine Mapping Type defines the mapping between a PHP type and
a PHPCR property type. PHPCR defines a finite set of allowed types for properties.
For example, the Doctrine Mapping Type ``string`` defines the
-mapping from a PHP string to a PHPCR\\PropertyType::STRING.
+mapping from a PHP string to a ``PHPCR\\PropertyType::STRING``.
Here is a quick overview of the built-in mapping types:
See `PHPCR\\PropertyType <http://phpcr.github.io/doc/html/files/phpcr.src.PHPCR.PropertyType.html>`_ for details about the types.
@@ -135,8 +135,11 @@ See `PHPCR\\PropertyType <http://phpcr.github.io/doc/html/files/phpcr.src.PHPCR.
- ``Name``: A valid PHPCR name
- ``Path``: A valid PHPCR path
- ``Uri``: A valid URI, for example a URL
-- ``Uuid``: A PHPCR universally unique id for a document (read only, see :ref:`References <association-mapping_referenceable>` for more)
+Each document can have a unique identifier for referencing it. While the uuid is
+also exposed as a read-only string property, the proper mapping for it is mapping
+it as UUID. See :ref:`References <association-mapping_referenceable>` for more
+information.
.. note::
@@ -173,9 +176,6 @@ specifies the Doctrine Mapping Type to use for the field. If the
type is not specified, PHPCR-ODM will try to let the PHPCR implementation determine
a suitable type.
-Note that there are also shortcut annotations for each of the type, so you can use
-@String and so on.
-
Example:
.. configuration-block::
@@ -188,7 +188,7 @@ Example:
{
/** @Field(type="long") */
private $count;
- /** @String */
+ /** @Field(type="string") */
private $name; // type defaults to string
//...
}
@@ -263,7 +263,7 @@ Unless specified as true, properties are considered single value.
.. code-block:: php
<?php
- /** @String(multivalue=true) */
+ /** @Field(type="string", multivalue=true) */
private $names;
.. code-block:: xml
@@ -295,10 +295,10 @@ the list keys.
.. code-block:: php
<?php
- /** @String(assoc="") */
+ /** @Field(type="string", assoc="") */
private $names;
- /** @String(assoc="listArraykeys") */
+ /** @Field(type="string", assoc="listArraykeys") */
private $list;
.. code-block:: xml
@@ -357,7 +357,7 @@ Every document has an identifier. The id in PHPCR-ODM is the PHPCR path.
id will change. This was discussed thoroughly and is considered the best solution.
If you need to reference a document reliably even when moving, look at the @ReferenceOne and the @Uuid
- annotations explained in the next chapter.
+ annotations explained in the :doc:`next chapter <association-mapping>`.
While you can manually assign the id, this is not recommended. When manually assigning, you need
to ensure that the parent document resulting from the assigned path exists. The recommended way
View
6 en/reference/multilang.rst
@@ -57,19 +57,19 @@ attribute on all fields that should be different depending on the locale.
/**
* Untranslated property
- * @Date
+ * @Field(type="date")
*/
private $publishDate;
/**
* Translated property
- * @String(translated=true)
+ * @Field(type="string", translated=true)
*/
private $topic;
/**
* Language specific image
- * @Binary(translated=true)
+ * @Field(type="binary", translated=true)
*/
private $image;
}
View
2 en/reference/working-with-objects.rst
@@ -113,7 +113,7 @@ from newly opened DocumentManager::
private $id;
/**
- * @String
+ * @Field(type="string")
*/
private $headline;

0 comments on commit 01f0b07

Please sign in to comment.
Something went wrong with that request. Please try again.