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..$#_]);
27 return join(" AND ", map { "$_ = ?" } $class->primary_columns);
31 my ($self, @groups) = @_;
32 @groups = ('All') unless @groups;
34 $want{$_} = 1 for map { keys %{$self->_column_groups->{$_}} } @groups;
35 if (my @want = grep { !exists $self->{'_column_data'}{$_} } keys %want) {
36 my $cursor = $self->result_source->storage->select(
37 $self->result_source->name, \@want,
38 \$self->_ident_cond, { bind => [ $self->_ident_values ] });
39 #my $sth = $self->storage->select($self->_table_name, \@want,
40 # $self->ident_condition);
41 # Not sure why the first one works and this doesn't :(
42 my @val = $cursor->next;
43 #warn "Flesh: ".join(', ', @want, '=>', @val);
44 foreach my $w (@want) {
45 $self->{'_column_data'}{$w} = shift @val;