From: Chris W. <ch...@cw...> - 2001-11-05 05:11:06
|
* Terrence Brannon (bl...@sv...) [011104 15:30]: > SPOPS::Manual::Object does not state that multivalued fields are > emulated for databases... does it emulate them? Nope. Multivalued fields are relatively new and are only implemented in the LDAP datastore right now. > If not, what are we supposed to do when using CGI.pm and we get back > a param() which returns us an array ref? Good question. How do you deal with it now? > How can we store this transparently in a SPOPS object which goes to > a database storage technology? I haven't had to deal with it yet so it's not in there. It seems there are several different ways to handle this. For instance, if the list of items doesn't have any dependencies outside the object and/or table, you could create a pre-save action which serializes the values using Data::Dumper (or even just using 'join') and create a post-fetch action which unserializes them. Neat, simple and transparent. But usually the task at hand is more complicated. Future relationship modifications should make it possible to deal with this transparently when the objects are in different tables. So you could access a list of dependent objects as a property of the object rather than calling a method to fetch them. If you're interested in this, check a post from Ray Zimmerman in the openinteract-dev mailing list from June/July of this year. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |