From 53cd9c4ca8d33cfe40cf3e872094bd117472ab29 Mon Sep 17 00:00:00 2001 From: Dmytro Boiko Date: Sat, 19 Nov 2016 23:34:10 +0200 Subject: [PATCH] Added examples for version column in the xml and yml formats --- .../transactions-and-concurrency.rst | 74 ++++++++++++++----- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/docs/en/reference/transactions-and-concurrency.rst b/docs/en/reference/transactions-and-concurrency.rst index 3c8cfe33b..1b79adc57 100644 --- a/docs/en/reference/transactions-and-concurrency.rst +++ b/docs/en/reference/transactions-and-concurrency.rst @@ -187,30 +187,68 @@ has been modified by someone else already. You designate a version field in an entity as follows. In this example we'll use an integer. -.. code-block:: php +.. configuration-block:: - + + + + + + .. code-block:: yaml + + User: + type: entity + fields: + version: + version: + type: integer Alternatively a datetime type can be used (which maps to a SQL timestamp or datetime): -.. code-block:: php +.. configuration-block:: - + + + + + + .. code-block:: yaml + + User: + type: entity + fields: + version: + version: + type: datetime Version numbers (not timestamps) should however be preferred as they can not potentially conflict in a highly concurrent