Skip to content

Commit 094a6f5

Browse files
authored
Avoid performing a type conversion
`object_id` is of type `varchar`, whereas the parameter is passed as an integer. This forces MySQL to perform a type conversion from integer to string which has a performance impact in the SQL query.
1 parent 7a728c8 commit 094a6f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Gedmo/Loggable/Entity/Repository/LogEntryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getLogEntriesQuery($entity)
5656
$dql .= " AND log.objectClass = :objectClass";
5757
$dql .= " ORDER BY log.version DESC";
5858

59-
$objectId = $wrapped->getIdentifier();
59+
$objectId = (string) $wrapped->getIdentifier();
6060
$q = $this->_em->createQuery($dql);
6161
$q->setParameters(compact('objectId', 'objectClass'));
6262

0 commit comments

Comments
 (0)