protected function XMLMigration::applyMappings in Migrate 6.2
Same name and namespace in other branches
- 7.2 plugins/sources/xml.inc \XMLMigration::applyMappings()
A normal $data_row has all the input data as top-level fields - in this case, however, the data is embedded within a SimpleXMLElement object in $data_row->xml. Explode that out to the normal form, and pass on to the normal implementation.
Overrides Migration::applyMappings
File
- plugins/
sources/ xml.inc, line 253 - Support for migration from XML sources.
Class
- XMLMigration
- Migrations using XML sources should extend this class instead of Migration.
Code
protected function applyMappings() {
// We only know what data to pull from the xpaths in the mappings.
foreach ($this->fieldMappings as $mapping) {
$source = $mapping
->getSourceField();
if ($source) {
$xpath = $mapping
->getXpath();
if ($xpath) {
// Derived class may override applyXpath()
$this->sourceValues->{$source} = $this
->applyXpath($this->sourceValues, $xpath);
}
}
}
parent::applyMappings();
}