[Dbix-class] $c->stash for complex/cascaded relationship bridges

Roland Philibert rphilibert at aptina.com
Tue Jan 24 13:27:19 GMT 2012


Thanks all for the tip,

For the record, one resolution to my example is:

 

    my $arr1 =  $c->model('DB')->resultset('Table1')->search({table1id
=> $pk,},{});

    my @rs2 =
$arr1->related_resultset('table3s')->related_resultset('ftable2id')

                                   ->search({},{result_class =>
'DBIx::Class::ResultClass::HashRefInflator',});

    my @rs5 =
$arr1->related_resultset('table3s')->related_resultset('ftable2id')->rel
ated_resultset('table5s')

                                  ->search({},{result_class =>
'DBIx::Class::ResultClass::HashRefInflator',});

    my @rs4 =
$arr1->related_resultset('table3s')->related_resultset('ftable2id')->rel
ated_resultset('table5s')->related_resultset('ftable4id')

                                  ->search({},{result_class =>
'DBIx::Class::ResultClass::HashRefInflator',});

 

    my %hash = (   rs1    =>  $arr1,    rs2     =>  \@rs2,  rs3     =>
\@rs3,  rs4     =>  \@rs4,    rs5     =>  \@rs5,    );


    $c->stash ( rs => \%hash );

 

Now I can build a hierarchy sort of tree in my view.

 


Aptina (UK) Limited, Century Court, Millennium Way, Bracknell, Berkshire, RG12 2XT. Registered in England No. 06570543.

This e-mail and any attachments contain confidential information and are solely for the review and use of the intended recipient. If you have received this e-mail in error, please notify the sender and destroy this e-mail and any copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20120124/2c320725/attachment.htm


More information about the DBIx-Class mailing list