From e43b9e9e3a14f90213e4c8fe52f08e9df9cc1c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Fri, 9 Sep 2016 07:52:44 +0000 Subject: [PATCH] Use `isIdGeneratorIdentity()` to add the ID on query It's quite handy when creating CUSTOM id generators that should also rely on AUTO_INCREMENT stuff (one can just extend the `ClassMedatadaFactory` and create a different instance of `ClassMetadata` that overrides that method). --- lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index c62a10a12..d577df6d9 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -1442,7 +1442,7 @@ class BasicEntityPersister implements EntityPersister continue; } - if ($this->class->generatorType != ClassMetadata::GENERATOR_TYPE_IDENTITY || $this->class->identifier[0] != $name) { + if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; }