Re: [CDBI] has_a infation of a Time::Piece woes

[prev] [thread] [next] [Date index for 2005/10/24]

From: William Ross
Subject: Re: [CDBI] has_a infation of a Time::Piece woes
Date: 18:25 on 24 Oct 2005
On 24 Oct 2005, at 18:04, Peter Speltz wrote:

> On 10/24/05, William Ross <will@xxxxxxx.xxx> wrote:
>
>>> <snip>
>>
>> Have you overridden _croak()? Your code wouldn't normally work
>> because Class::DBI::Relationship::HasA will call _croak if the return
>> value of the custom inflation method is not blessed into the class it
>> expects to see. Which isn't very helpful in your case.
>>
>
> No i have not overridden _croak to do this. Apparently if the custom
> inflate method does not return a  object , then it will pass that onto
> the constructor. Maybe the docs need updated.

ah, my mistake. I missed the second conditional.

it does this:

     return $value if ref $value and $value->isa( $a_class );
     $self->_croak if ref $value;

so if the inflator returns a simple value or undef then it doesn't  
croak and carries on to call the default construction method. As you  
say, it even passes $value to the constructor. Perhaps in a previous  
version this was helpful (returning an id for inflation?), but now it  
seems like a bug.

sorry: replied in too much of a hurry (to get out and walk the dog!)

will

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] has_a infation of a Time::Piece woes
Peter Speltz 16:31 on 24 Oct 2005

Re: [CDBI] has_a infation of a Time::Piece woes
Perrin Harkins 16:38 on 24 Oct 2005

Re: [CDBI] has_a infation of a Time::Piece woes
William Ross 16:47 on 24 Oct 2005

Re: [CDBI] has_a infation of a Time::Piece woes
Peter Speltz 17:04 on 24 Oct 2005

Re: [CDBI] has_a infation of a Time::Piece woes
William Ross 18:25 on 24 Oct 2005

Generated at 14:18 on 27 Oct 2005 by mariachi v0.52