Skip to content

Commit

Permalink
add xml example to lock protection cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
mcwebb committed Oct 21, 2015
1 parent 711c976 commit 57a9e8f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Resources/doc/cookbook/recipe_lock_protection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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::
Expand Down

0 comments on commit 57a9e8f

Please sign in to comment.