Prevents prefixing a column when false
on column-prefix
(XML)
This commit is contained in:
parent
ef65270387
commit
82cda1ecb0
1 changed files with 10 additions and 1 deletions
|
@ -255,11 +255,20 @@ class XmlDriver extends FileDriver
|
||||||
|
|
||||||
if (isset($xmlRoot->embedded)) {
|
if (isset($xmlRoot->embedded)) {
|
||||||
foreach ($xmlRoot->embedded as $embeddedMapping) {
|
foreach ($xmlRoot->embedded as $embeddedMapping) {
|
||||||
|
$columnPrefix = isset($embeddedMapping['column-prefix'])
|
||||||
|
? (string) $embeddedMapping['column-prefix']
|
||||||
|
: null;
|
||||||
|
|
||||||
|
$preventPrefixing = (
|
||||||
|
$columnPrefix === '0' || $columnPrefix === 'false'
|
||||||
|
);
|
||||||
|
|
||||||
$mapping = array(
|
$mapping = array(
|
||||||
'fieldName' => (string) $embeddedMapping['name'],
|
'fieldName' => (string) $embeddedMapping['name'],
|
||||||
'class' => (string) $embeddedMapping['class'],
|
'class' => (string) $embeddedMapping['class'],
|
||||||
'columnPrefix' => isset($embeddedMapping['column-prefix']) ? (string) $embeddedMapping['column-prefix'] : null,
|
'columnPrefix' => $preventPrefixing ? false : $columnPrefix
|
||||||
);
|
);
|
||||||
|
|
||||||
$metadata->mapEmbedded($mapping);
|
$metadata->mapEmbedded($mapping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue