Joss Shaw <[EMAIL PROTECTED]> writes: > Hi there, > Im using some crusty template engine, the only one > installed on my target machine which means I need to > send all data to the engine in a hashref format only - > I can't call object methods. > > I've got a table which has quite a few relationships > defined on it. […] > Is it possible to pull all data from a related table like this ? If > so,please please tell me - am so stuck. big big thanks for anything,
Take a look at the HashRefInflator result class: <http://search.cpan.org/~jrobinson/DBIx-Class-0.07999_02/lib/DBIx/Class/ResultClass/HashRefInflator.pm> To get the related columns as well, just use prefetch: my $rs = $schema->resultset('MyTable') my $search_rs = $rs->search({ key => $value }, { prefetch => 'has_many_relationship' }); $search_rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); $hashref = $search_rs->first;; -- ilmari "A disappointingly low fraction of the human race is, at any given time, on fire." - Stig Sandbeck Mathisen _______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
