[Dbix-class] get_columns() with inflaters

Matt S Trout dbix-class at trout.me.uk
Wed Mar 29 23:37:50 CEST 2006


Michele Beltrame wrote:
> Hi!
> 
>> my %hash = map { ($_ => $o->$_) } $o->columns;
> 
> Thanks Matt, this was so easy I didn't even think of it. I don't know
> why, I was looking for a method which did all automatically. ;-)

DBIC doesn't tend to get convenience methods that encapsulate what I consider 
a bloody obvious perl idiom unless somebody else implements them and supplies 
a patch with tests. Mmm, and I turn 23 in an hour and a half. Somebody fetch 
me my pipe and slippers so I can sit around saying "bah" and saying how much 
better it was in the old days :)

-- 
      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