[Dbix-class] get_column auto-inflate

Christopher Laco claco at chrislaco.com
Tue Jul 22 01:51:10 BST 2008


Christopher H. Laco wrote:
> Todd Rinaldo wrote:
>> get_inflated_columns doesn't return a hash like get_columns does. I'm 
>> looking for get_columns with an inflate option.
>>
>> thanks,
> 
> Huh? get_columns returns a list just like get_inflated
> _columns does.
> 
> I believe the pod is wrong.
> 
> 
> sub get_inflated_columns {
>   my $self = shift;
>   return map {
>     my $accessor = $self->column_info($_)->{'accessor'} || $_;
>     ($_ => $self->$accessor);
>   } $self->columns;
> }
> 
> 
> sub get_columns {
>   my $self = shift;
>   if (exists $self->{_inflated_column}) {
>     foreach my $col (keys %{$self->{_inflated_column}}) {
>       $self->store_column($col, $self->_deflated_column($col, 
> $self->{_inflated_column}{$col}))
>         unless exists $self->{_column_data}{$col};
>     }
>   }
>   return %{$self->{_column_data}};
> }
> 
> sub get_dirty_columns {
>   my $self = shift;
>   return map { $_ => $self->{_column_data}{$_} }
>            keys %{$self->{_dirty_columns}};
> }

Looks like someone corrected the docs already.



More information about the DBIx-Class mailing list