Explorar el Código

add more config info to Lock Protection cookbook

Matthew Webb hace 9 años
padre
commit
9bf0180814
Se han modificado 1 ficheros con 25 adiciones y 0 borrados
  1. 25 0
      Resources/doc/cookbook/recipe_lock_protection.rst

+ 25 - 0
Resources/doc/cookbook/recipe_lock_protection.rst

@@ -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::