kanduvisla/importcsv — Issue #4: Support `prepareImportValue` function?
Author: brendo
Created: 2012-02-06 05:51:55+00:00
State: open

If you aren't already aware, the XMLImporter extension does a similar thing to the Import CSV extension in that it needs to take a single value and allow fields to process it so that it can be correctly saved.

While I love the idea of drivers for each field, it places a little of the responsibility on the you to maintain the pull requests for each field and it can be unmanageable.

To prevent this, the XMLImporter looks for a `prepareImportValue` on the Field class, which is given a string and returns an array ready for insertion.

Perhaps it'd be nice if Import CSV extension also checked to see if the Field has implemented this function before falling back to use the default driver?

So the pecking order would then be:

1. Field's `prepareImportValue` function
2. Specific Field Driver
3. Default Field Driver

What do you think?