Skip to content
Snippets Groups Projects
Commit 92017c59 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

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
No related branches found
No related tags found
No related merge requests found
Pipeline #7698 failed
...@@ -229,7 +229,13 @@ class SchemaService extends AbstractService ...@@ -229,7 +229,13 @@ class SchemaService extends AbstractService
$metadata = $this->getEntityManager()->getClassMetadata($className); $metadata = $this->getEntityManager()->getClassMetadata($className);
$tableName = $metadata->getTableName(); $tableName = $metadata->getTableName();
if ($metadata->hasAssociation($fieldName)) {
$association = $metadata->getAssociationMapping($fieldName);
$columnName = isset($association['joinColumns'][0]['name']) ? $association['joinColumns'][0]['name'] : $fieldName;
} else {
$columnName = $metadata->getColumnName($fieldName); $columnName = $metadata->getColumnName($fieldName);
}
$importCols = $this->getImportCols($tableName); $importCols = $this->getImportCols($tableName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment