[Dbix-class] using $row->get_columns and/or $result_set->result_source->columns with proxied columns

Matt S Trout dbix-class at trout.me.uk
Tue Oct 3 21:50:47 CEST 2006


John Napiorkowski wrote:
> Hi,
> 
> I've seen quite a few messages on this list regarding
> the use of proxied or added columns but I was hoping
> someone could clarify a question for me.  If I add a
> column to a schema using the proxy attribute like so:
> 
> __PACKAGE__->belongs_to(
> 
>   type_id => 'Window', 
>   { 'self.type_id => 'foreign.type_id},
>   { proxy => [ qw/type_name/ ] },
> 
> );
> 
> in my schema modules  I have no trouble accessing it
> using
> 
>   $row->type_name
> 
> but it doesn't seem to show up in "$row->get_columns"
> or in "$result_set->result_source->columns".

Of course not, they aren't columns on the object.


> Is there some way to get these proxied columns
> programatically?  Or should the above work and I'm
> just doing something wrong (likely :) ).

$result_source->relationship_info($relname)->{attrs}{proxy}

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list