1
0
mirror of synced 2025-02-09 00:39:25 +03:00

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).
This commit is contained in:
Luís Cobucci 2016-09-09 07:52:44 +00:00
parent e7e142ea4a
commit e43b9e9e3a
No known key found for this signature in database
GPG Key ID: 8042585A7DBC92E1

View File

@ -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'];
}