I'm writing a plugin for migrating to entities based on the Entity API (commerce, og, all contrib around them).
Currently, Entity API promotes using their own controller, and placing custom logic (initializing defaults, pre/post load, save, etc) in an entity class.
So a custom_example entity is in fact an instance of it's class, for example EntityCustomExample.
Commerce doesn't use this pattern (yet), but Og, and the contribs do.
Since MigrateFieldsEntityHandler assumes $entity is an stdClass, I need to cast and recast the $entity several times (once for prepare, then back for save, then once again for complete), which is very ugly.
So, consider this patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1132034_followup.patch | 1.13 KB | bojanz |
| fields.patch | 6.78 KB | bojanz |
Comments
Comment #1
moshe weitzman commentedSeems reasonable to me.
Comment #2
mikeryanCommitted to D6 and D7 branches, and also made corresponding changes to migrate_extras. Anyone who has implemented field handlers will need to be sure to remove stdClass from the prepare() and complete() signatures.
Thanks!
Comment #3
bojanz commentedOkay, I missed one, the path destination handler.
Here's a followup.
Thank you for the quick replies yesterday.
Comment #4
mikeryanCommitted, thanks!