Re: missing the point about mapping from database to object to external rep

[prev] [thread] [next] [Date index for 2004/12/03]

From: Perrin Harkins
Subject: Re: missing the point about mapping from database to object to external rep
Date: 21:37 on 03 Dec 2004
On Fri, 2004-12-03 at 13:29 -0800, Randal L. Schwartz wrote:
> But also, while I'm setting the value, I want to be able to say:
> 
>         My::Event->create({ start_date => '11/22/04', end_date => '12/1/04'})
> 
> and have it trigger *some* code to turn those values into Time::Piece,
> maybe with a few variant input forms.

You've already eaten your cake, so now you can't have it.  If you tell
Class::DBI you're going to be storing Time::Piece objects there, you
have to actually give it Time::Piece objects.

The simplest thing is to use Time::Piece->strptime() to make them on the
fly.  Anything else probably means rolling your own version of has_a().

- Perrin

(message missing)

missing the point about mapping from database to object to external rep
merlyn (Randal L. Schwartz) 21:29 on 03 Dec 2004

Re: missing the point about mapping from database to object to external rep
Perrin Harkins 21:37 on 03 Dec 2004

Generated at 15:37 on 08 Dec 2004 by mariachi v0.52