class WPMigrationFromXML extends XMLMigration {
public function __construct($arguments) {
parent::__construct($arguments);
$items_url = 'http://ecapy.com/wp-content/uploads/2013/06/wordpress.xml_._renombrar.txt';
$item_xpath = '/rss/item';
$item_ID_xpath = 'wp:post_id';
$this->source = new MigrateSourceXML($items_url, $item_xpath, $item_ID_xpath);
$this->destination = new MigrateDestinationNode('page');
$this->map = new MigrateSQLMap($this->machineName,
array(
'wp:post_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
)
),
MigrateDestinationNode::getKeySchema()
);
$this->addFieldMapping('uid')->defaultValue(1);
$this->addFieldMapping('created', 'wp:post_date')->xpath('wp:post_date');
$this->addFieldMapping('title', 'title')->xpath('title');
$this->addFieldMapping('body', 'content:encoded')->xpath('content:encoded');
}
}