Want to allow creation and updating of the attribute_data Eloquent field using the same consistent format. Currently, creation routines use a different format, and the mapping function adds in the channels which are not provided.
The idea is we test the attribute data array to see how deep it is. If it is "shallow" then we assume it requires mapping, but if it's the correct depth (attribute > channel > language) then we assume the attribute data is already in the correct format. I guess we could go further if we wanted by checking for valid locales or similar.
Yeah I think it would be handy to have. It's something that has tripped people up and currently not that nice. Maybe if we get some tests in (even if they fail) it'll be clearer to see what we're doing etc etc
Untested, just an idea at present.
Want to allow creation and updating of the
attribute_data
Eloquent field using the same consistent format. Currently, creation routines use a different format, and the mapping function adds in the channels which are not provided.The idea is we test the attribute data array to see how deep it is. If it is "shallow" then we assume it requires mapping, but if it's the correct depth (attribute > channel > language) then we assume the attribute data is already in the correct format. I guess we could go further if we wanted by checking for valid locales or similar.