|
@@ -32,6 +32,8 @@ You can enable it in your ``sonata_admin`` configuration :
|
|
|
|
|
|
You must also configure each entity that you want to support by adding a field called ``$version`` on which the Doctrine ``Version`` feature is activated.
|
|
|
|
|
|
+Using Annotations:
|
|
|
+
|
|
|
.. code-block:: php
|
|
|
|
|
|
<?php
|
|
@@ -53,6 +55,23 @@ You must also configure each entity that you want to support by adding a field c
|
|
|
// ...
|
|
|
}
|
|
|
|
|
|
+Using XML:
|
|
|
+
|
|
|
+.. code-block:: xml
|
|
|
+
|
|
|
+ <?xml version="1.0" encoding="utf-8"?>
|
|
|
+ <!-- src/AppBundle/Resources/orm/Car.orm.xml -->
|
|
|
+ <doctrine-mapping>
|
|
|
+ <entity name="AppBundle\Entity\Car">
|
|
|
+ <!-- ... -->
|
|
|
+
|
|
|
+ <field name="version" type="integer" version="true" />
|
|
|
+
|
|
|
+ <!-- ... -->
|
|
|
+ </entity>
|
|
|
+ </doctrine-mapping>
|
|
|
+
|
|
|
+
|
|
|
For more information about this visit the `Doctrine docs <http://doctrine-orm.readthedocs.org/en/latest/reference/transactions-and-concurrency.html?highlight=optimistic#optimistic-locking>`_
|
|
|
|
|
|
.. note::
|