Problem/Motivation
Sources and destinations are sharing some common methods like getIds()
and fields()
. They are referring exactly the same things but each on the opposite endpoint of the pipe.
Proposed resolution
Create a new interface \Drupal\migrate\Plugin\MigrateEndpointInterface
and move ::getIds()
and fields()
from MigrateSourceInterface and MigrateDestinationInterface there. Make MigrateSourceInterface and MigrateDestinationInterface extend the new MigrateEndpointInterface
. I'm not sure that the "endpoint" term from the interface name is the best - I'm not a native English speaker. By that, I want to describe something that is either source or destination. Opinions?
Right now, this hard blocked by #2543568: Remove the md_entity destination plugin hack but depends also on #2783715: Entity destination ID schema should match entity ID definition in terms of documentation.
Remaining tasks
Un-postpone when #2543568: Remove the md_entity destination plugin hack is in.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2820642-5.patch | 10.67 KB | claudiu.cristea |
Comments
Comment #4
quietone CreditAttribution: quietone as a volunteer commentedNo longer postponed
Comment #5
claudiu.cristeaI guess this is all (still not sure on the destination deprecated parameter, while we cannot change the signature in dest interface because of PHP 7.2)
Comment #7
heddnWhat purpose does adding the interface serve? There doesn't seem to be a compelling reason to do this.
Comment #8
phenaproximaWe discussed this in the Migrate maintainer call, and I'm not 100% convinced that this is needed either. It is a little cleaner, but I don't think it confers a lot of benefit now that Migrate's API is stable. I'm open to being persuaded otherwise, though.
Comment #12
quietone CreditAttribution: quietone as a volunteer commentedDiscussed at the migration meeting today on Slack and there were no objections to closing this issue, including from claudiu.cristea.
Closing as won't fix.