From bd0e0c3fcf2e33d9332c858c37ac178bbf8a22bc Mon Sep 17 00:00:00 2001 From: Diego Mazzaro Date: Sun, 29 Sep 2013 16:17:10 +0200 Subject: [PATCH] [bugfix] if BIGINT or SMALLINT version field was not incremented. Made version field accepted type coherent between ClassMetadataInfo and BasicEntityPersister --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 00b00cfa2..c594f3bbf 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -464,7 +464,9 @@ class BasicEntityPersister $params[] = $this->class->reflFields[$versionField]->getValue($entity); switch ($versionFieldType) { + case Type::SMALLINT: case Type::INTEGER: + case Type::BIGINT: $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; break; @@ -1974,4 +1976,4 @@ class BasicEntityPersister $sql = implode(' AND ', $filterClauses); return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" } -} +} \ No newline at end of file