Commit 92017c59 authored by Laurent Lécluse's avatar Laurent Lécluse

Prise en compte des associations pour pouvoir retrouver le nom de la colonne...

Prise en compte des associations pour pouvoir retrouver le nom de la colonne qui correspond à une propriété Doctrine
parent a30dd89d
Pipeline #7698 failed with stage
in 18 seconds
......@@ -229,7 +229,13 @@ class SchemaService extends AbstractService
$metadata = $this->getEntityManager()->getClassMetadata($className);
$tableName = $metadata->getTableName();
$columnName = $metadata->getColumnName($fieldName);
if ($metadata->hasAssociation($fieldName)) {
$association = $metadata->getAssociationMapping($fieldName);
$columnName = isset($association['joinColumns'][0]['name']) ? $association['joinColumns'][0]['name'] : $fieldName;
} else {
$columnName = $metadata->getColumnName($fieldName);
}
$importCols = $this->getImportCols($tableName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment