optimized query for getLastNumberFor function
This commit is contained in:
parent
8fa1e1089e
commit
da9d014c9d
1 changed files with 2 additions and 2 deletions
|
@ -112,9 +112,9 @@ class SequenceGenerator
|
|||
$em = $this->entityManager;
|
||||
|
||||
return $em->getConnection()->executeQuery(
|
||||
'SELECT MAX(number) AS count FROM ' . $em->getClassMetadata(Insert::class)->getTableName() . ' WHERE type=:type',
|
||||
'SELECT MAX(number) FROM ' . $em->getClassMetadata(Insert::class)->getTableName() . ' WHERE type = :type',
|
||||
['type' => $this->inferTypeFromSource($type)]
|
||||
)->fetchAll()[0]['count'];
|
||||
)->fetchAll(\PDO::FETCH_COLUMN)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue