|
@@ -29,6 +29,31 @@ You can enable it in your ``sonata_admin`` configuration :
|
|
sonata_admin:
|
|
sonata_admin:
|
|
options:
|
|
options:
|
|
lock_protection: true
|
|
lock_protection: true
|
|
|
|
+
|
|
|
|
+You must also configure each entity that you want to support by adding a ``version`` field.
|
|
|
|
+
|
|
|
|
+.. code-block:: php
|
|
|
|
+
|
|
|
|
+ <?php
|
|
|
|
+ // src/AppBundle/Entity/Car.php
|
|
|
|
+ namespace AppBundle\Entity\Car;
|
|
|
|
+
|
|
|
|
+ use Doctrine\ORM\Mapping as ORM;
|
|
|
|
+
|
|
|
|
+ class Car
|
|
|
|
+ {
|
|
|
|
+ // ...
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @ORM\Column(type="integer")
|
|
|
|
+ * @ORM\Version
|
|
|
|
+ */
|
|
|
|
+ protected $version;
|
|
|
|
+
|
|
|
|
+ // ...
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+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::
|
|
.. note::
|
|
|
|
|