Skip to content

Commit

Permalink
Merge pull request #1832 from gintarasba/patch-1
Browse files Browse the repository at this point in the history
Updated ORM.php optimization
  • Loading branch information
l3pp4rd authored Sep 20, 2017
2 parents 857654d + cadf50a commit 5351c26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Gedmo/Loggable/Mapping/Event/Adapter/ORM.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getNewVersion($meta, $object)
$em = $this->getObjectManager();
$objectMeta = $em->getClassMetadata(get_class($object));
$identifierField = $this->getSingleIdentifierFieldName($objectMeta);
$objectId = $objectMeta->getReflectionProperty($identifierField)->getValue($object);
$objectId = (string) $objectMeta->getReflectionProperty($identifierField)->getValue($object);

$dql = "SELECT MAX(log.version) FROM {$meta->name} log";
$dql .= " WHERE log.objectId = :objectId";
Expand Down

0 comments on commit 5351c26

Please sign in to comment.