[Dbix-class] Dinamic join conditions

Eden Cardim edencardim at gmail.com
Tue Sep 7 18:00:04 GMT 2010

>>>>> "Tiziano" == Tiziano Faion <tiziano at graphistudio.com> writes:

    Tiziano> my $allGroups_rs =
    Tiziano> $c->model('DbsMysql::Seminars::Gruppi')->search(undef, {
    Tiziano> from => \" (SELECT a.id , group_name, group_desc, testo ,
    Tiziano> img , role_id FROM seminari_gruppi a LEFT JOIN
    Tiziano> seminar_2_roles b ON a.id = b.seminar_group_id AND
    Tiziano> b.role_id = $id_role ) me" });

    Tiziano> but... how can i access role_id ? as i can do a thing like
    Tiziano> this push @{$json->{groups}} , { group_id => $r->id,
    Tiziano> group_desc => $r->group_desc, group_name => $r->group_name,
    Tiziano> cansee => defined $r->{role_id} ? JSON::XS::true :
    Tiziano> JSON::XS::false }; Thanks guys!


$rs->search({},{ '+select' => [qw(role_id)] })

   Eden Cardim       Need help with your Catalyst or DBIx::Class project?
  Code Monkey                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://blog.edencardim.com/            http://www.shadowcat.co.uk/servers/

More information about the DBIx-Class mailing list