Class::DBI and Time::Piece::MySQL woes

[prev] [thread] [next] [Date index for 2004/06/11]

From: Alexander =?iso-8859-1?Q?Gr=E4fe?=
Subject: Class::DBI and Time::Piece::MySQL woes
Date: 13:14 on 11 Jun 2004
Hi,

After upgrading to Class::DBI 0.96,
the following does not work anymore:

__PACKAGE__->has_a(angelegt => 'Time::Piece::MySQL',
        inflate => sub { Time::Piece->from_mysql_datetime( shift ); },
        deflate => 'mysql_datetime',
);

The error I get is:

Inflate method didn't inflate right at
/usr/lib/perl5/site_perl/5.8.0/Class/DBI/Relationship/HasA.pm line 59

Looking at HasA.pm, I suspect the problem is, that I tell CDBI, that
'angelegt' is a Time::Piece::MySQL object, but the object isn't really
Time::Piece::MySQL, rather, it's just Time::Piece.

I really would like to avoid having to copy the Time::Piece::MySQL code
into my CDBI class, so is there an easy way I can keep on using T::P::M?

Regards,
	Alexander Gräfe

Class::DBI and Time::Piece::MySQL woes
Alexander =?iso-8859-1?Q?Gr=E4fe?= 13:14 on 11 Jun 2004

Re: Class::DBI and Time::Piece::MySQL woes
Vince Veselosky 13:58 on 11 Jun 2004

Re: Class::DBI and Time::Piece::MySQL woes
Alexander =?iso-8859-1?Q?Gr=E4fe?= 14:03 on 11 Jun 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52