Re: Column accessor returning as a ref to Class::DBI::Column

[prev] [thread] [next] [Date index for 2005/01/26]

From: Y00R0B0T
Subject: Re: Column accessor returning as a ref to Class::DBI::Column
Date: 18:46 on 26 Jan 2005
okay:

package ED::CDBI::Class;
use base qw( ED::CDBI);

__PACKAGE__->table('classes');
__PACKAGE__->columns(Primary=>'class_id');
__PACKAGE__->columns(Essential=>qw|name etc|);

package ED::CDBI::Page;
use base qw( ED::CDBI );

__PACKAGE__->table('pages');
__PACKAGE__->columns(Primary=>'page_id');
__PACKAGE__->columns(Essential=>qw| class_id page_name etc|);

__PACKAGE__->has_a(class_id=>'Class');

later...

my ($p) = Page->retrieve(1);

print STDERR Data::Dumper::Dumper($p);


output:
$VAR1 = bless( {
                . . . ,
                 'class_id' => bless( {
                                        'school_id' => undef,
                                        'class_id' => bless( {
                                                               '_groups' => {
                                                                      
       'Primary' => 1,
                                                                      
       'Essential' => 1
                                                                            },
                                                              
'placeholder' => '?',
                                                              
'mutator' => 'school_id',
                                                              
'accessor' => 'school_id',
                                                               'name'
=> 'school_id'
                                                             },
'Class::DBI::Column' ),
                                        '4170' => undef
                                      }, 'ED::CDBI::Class' ),
               }, 'ED::CDBI::Page' );


the k/v pair 4170=>undef,  4170 is the correct class_id for this row
- hope that's enough information.... sorry if it ain't.

-james

On Wed, 26 Jan 2005 17:49:25 +0000, Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote:
> On Wed, Jan 26, 2005 at 11:39:49AM -0600, Y00R0B0T wrote:
> > VAR= bless( {
> >                ....
> >                foo_id=> bless ({
> >                        fool_id=> bless({
> >                                    name=>'different_col',
> >                                    } Class::DBI::Column),
> >                 } FOO),
> 
> Please paste real code. It's much easier to see what's going on that
> way.
> 
> Tony
>

Re: Column accessor returning as a ref to Class::DBI::Column
Y00R0B0T 18:46 on 26 Jan 2005

Generated at 17:42 on 27 Jan 2005 by mariachi v0.52