Chris, > I'm curious if DM can map 2 columns to a single Range object. The > scenario I have is a way to represent the term, or life, of an > insurance plan. In the database, the start and end dates would be in > individual columns. In the Plan object, I want those dates contained > within a single Range.
What you're talking about is usually referred to as an Embedded Value: http://www.martinfowler.com/eaaCatalog/embeddedValue.html There are plans to add this to DataMapper, either in core or as a plugin after 0.10.0 is released. Initially I'll probably try to develop it as a plugin, but I think it's such a useful feature that it may make it's way into core once it's been fully specced and it's seen some real-world usage. For now your best approach is to add an accessor to your model that returns the Range object from the two attributes, and a mutator that allows you to set a new Range object and propagates the values down to the two attributes. Dan (dkubb) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/datamapper?hl=en -~----------~----~----~----~------~----~------~--~---
