[Dbix-class] InflateColumn::DateTime

Christopher H. Laco claco at chrislaco.com
Thu Jun 8 20:40:45 CEST 2006


> My problem is in deflate:
> 
>>       $column =>
>>         {
>>           inflate => sub {
>>             my ($value, $obj) = @_;
>>             $obj->_datetime_parser->parse_datetime($value);
>>           },
>>           deflate => sub {
>>             my ($value, $obj) = @_;
> 		$obj is not an object, just a class name during a create_related calls?
>>             $obj->_datetime_parser->format_datetime($value);
>>           },
>>         }
> 
> 
> 
> Is it normal that the deflate sub get's a class name, and not an actuall
> blessed object for $obj?
> 
> -=Chris
> 

OK, The offending bits are:

>   if (my $parser = $self->__datetime_parser) {
>     return $parser;
>   }

from _datetime_parser() in InflateColumn::DateTime.

If it is indeed normal deflate subs to get a class and not an object,
then that line won't cut it because of the accessors trying to look at a
blessed hash.

If it's not normal for deflate subs to get class names instead of
objects for $obj, then something is quite amiss elsewhere.

Considering regular inflate/deflate works with my copy-item code, I'm
betting on the former here.

Someone who know more about the internals will have to chime in.

-=Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/dbix-class/attachments/20060608/4729bd40/attachment.pgp 


More information about the Dbix-class mailing list