From 8fa1e1089ee995e8c0673001031298f7ecdb78a9 Mon Sep 17 00:00:00 2001 From: Robin Krahnen Date: Wed, 4 Apr 2018 23:48:06 +0200 Subject: [PATCH] use entity manager to resolve class table name --- Classes/Service/SequenceGenerator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/Service/SequenceGenerator.php b/Classes/Service/SequenceGenerator.php index 63cbde4..fd65201 100644 --- a/Classes/Service/SequenceGenerator.php +++ b/Classes/Service/SequenceGenerator.php @@ -1,6 +1,7 @@ entityManager; try { $em->getConnection()->insert( - 'digicomp_sequence_domain_model_insert', + $em->getClassMetadata(Insert::class)->getTableName(), ['number' => $count, 'type' => $type] ); return true; @@ -111,7 +112,7 @@ class SequenceGenerator $em = $this->entityManager; return $em->getConnection()->executeQuery( - 'SELECT MAX(number) AS count FROM digicomp_sequence_domain_model_insert WHERE type=:type', + 'SELECT MAX(number) AS count FROM ' . $em->getClassMetadata(Insert::class)->getTableName() . ' WHERE type=:type', ['type' => $this->inferTypeFromSource($type)] )->fetchAll()[0]['count']; }