I am trying to do write a migration class extending the Migrate module. The migration will be from an XML file so I will want to extend the XMLMigration
class. Based on the Migrate modules wine.inc example, I'm going to have to something like this:
class WineProducerXMLPullMigration extends XMLMigration {
public function __construct($arguments) {
....
$item_xpath = '/producers/producer'; // relative to document
$item_ID_xpath = 'sourceid'; // relative to item_xpath
$this->source = new MigrateSourceXML($items_url, $item_xpath,
$item_ID_xpath, $fields);
}
}
My issue is that my xml doesn't have any unique ID per row, and therefore I can't really pass a $item_ID_path
. I read this post https://www.drupal.org/node/1444356#comment-6974360 and found that the prepareKey() function is supposed to be used for this purpose, however as far as I can tell, you don't ever call this directly, and its called after this class is finished processing. This being the case, I'm not sure what I should be passing in $item_ID_xpath
and it is a required field.