[Dbix-class] get_columns/get_inflated_columns

Matt S Trout dbix-class at trout.me.uk
Mon May 21 19:14:34 GMT 2007


On Mon, May 21, 2007 at 01:32:27PM -0400, Christopher H. Laco wrote:
> > Sure, but it has to obey ->{accessor} (and you'll need to patch inflate_column
> > to while you're there) and there'll need to be tests.
> 
> return map {$_ => $self->$_} $self->columns;
> 
> Why do I have to patch inflate_column or care if I'm using the accessor?

the $self->$_ may not be correct. accessor name may not match column name.

column_info accessor key determines this for column accessor; inflate_column
should obey this but I don't think currently does.
 
> > 
> > Oh, and how do you propose to handle people wanting rels as well?
> 
> I don't, just like get_columns doesn't.
> 
> > 
> > Or non-column attributes? (c.f. Oleg's horrible hack because he wanted to
> > use get_columns on non-column things)
> > 
> 
> I don't, just like get_columns doesn't.
> 
> 
> I'm proposing that get_inflated_columns is no smarter than get_columns
> or than I get the objects instead of their values...

Well, fair enough, but you're putting fuel on the fire of ::Core getting
deprecated entirely in favour of something that doesn't need hacks like this.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Dbix-class mailing list