From 8e73926359e0c34a23f8f544b69b06e9ee58dd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98Andrey=20Lukin=E2=80=99?= <‘lukin.andrej@gmail.com’> Date: Fri, 16 Feb 2018 11:48:31 +0300 Subject: [PATCH] Add version fields into L2C data --- lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php b/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php index b654c0425..62f76205e 100644 --- a/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php +++ b/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php @@ -75,6 +75,10 @@ class DefaultEntityHydrator implements EntityHydrator $data = $this->uow->getOriginalEntityData($entity); $data = array_merge($data, $metadata->getIdentifierValues($entity)); // why update has no identifier values ? + if ($metadata->isVersioned) { + $data[$metadata->versionField] = $metadata->getFieldValue($entity, $metadata->versionField); + } + foreach ($metadata->associationMappings as $name => $assoc) { if ( ! isset($data[$name])) { continue;