It seems that with #1605050: After upgrading to 2.4-dev sourceMigration fails silently on Entity migrations the getKeySchema() function was changed from a static to a regular method. The obvious downside to this seems to be that I cannot use getKeySchema() with this handler like I can with the other destination handlers, which have static methods:

Node migration:

$this->destination = new MigrateDestinationNode('my_node_type');
$this->map = new MigrateSQLMap($this->machineName, $source_key_schema, MigrateDestinationNode::getKeySchema());

Entity migration:

$this->destination = new MigrateDestinationEntityAPI('my_entity_type', 'my_bundle');
$this->map = new MigrateSQLMap($this->machineName, $source_key_schema, $this->destination->getKeySchema());

Where I would have expected to be able to use the following in an Entity migration:

$this->map = new MigrateSQLMap($this->machineName, $source_key_schema, MigrateDestinationEntityApi::getKeySchema('my_entity_type'));

This causes a bit of a DX WTF when writing migrations.

Comments

rob_johnston’s picture

Agreed, as this is how the migrate_d2d module does it: http://drupalcode.org/project/migrate_d2d.git/blob/HEAD:/entity.inc#l67

There's a patch at #1944118: Migrate EntityAPI for entities with existing entity keys that puts "static" back in (and some other things).