1 package # hide from PAUSE
2 DBIx::Class::CDBICompat::LazyLoading;
7 sub resultset_instance {
9 my $rs = $self->next::method(@_);
10 $rs = $rs->search(undef, { columns => [ $self->columns('Essential') ] });
15 my ($self, $col) = @_;
16 if ((ref $self) && (!exists $self->{'_column_data'}{$col})
17 && $self->{'_in_storage'}) {
18 $self->_flesh(grep { exists $self->_column_groups->{$_}{$col}
20 keys %{ $self->_column_groups || {} });
22 $self->next::method(@_[1..$#_]);
26 my ($self, @groups) = @_;
27 @groups = ('All') unless @groups;
29 $want{$_} = 1 for map { keys %{$self->_column_groups->{$_}} } @groups;
30 if (my @want = grep { !exists $self->{'_column_data'}{$_} } keys %want) {
31 my $cursor = $self->result_source->storage->select(
32 $self->result_source->name, \@want,
33 \$self->_ident_cond, { bind => [ $self->_ident_values ] });
34 #my $sth = $self->storage->select($self->_table_name, \@want,
35 # $self->ident_condition);
36 # Not sure why the first one works and this doesn't :(
37 my @val = $cursor->next;
38 #warn "Flesh: ".join(', ', @want, '=>', @val);
39 foreach my $w (@want) {
40 $self->{'_column_data'}{$w} = shift @val;