1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Prevents prefixing a column when false on column-prefix (XML)

This commit is contained in:
Andrey Knupp Vital 2015-01-07 17:14:59 -02:00
parent ef65270387
commit 82cda1ecb0

View File

@ -255,11 +255,20 @@ class XmlDriver extends FileDriver
if (isset($xmlRoot->embedded)) {
foreach ($xmlRoot->embedded as $embeddedMapping) {
$columnPrefix = isset($embeddedMapping['column-prefix'])
? (string) $embeddedMapping['column-prefix']
: null;
$preventPrefixing = (
$columnPrefix === '0' || $columnPrefix === 'false'
);
$mapping = array(
'fieldName' => (string) $embeddedMapping['name'],
'class' => (string) $embeddedMapping['class'],
'columnPrefix' => isset($embeddedMapping['column-prefix']) ? (string) $embeddedMapping['column-prefix'] : null,
'columnPrefix' => $preventPrefixing ? false : $columnPrefix
);
$metadata->mapEmbedded($mapping);
}
}