> I'd like to use a shortcut of the form :
> my $rsApplications=$rowUser->groups->applications
>
> But it does not seem to work. I get this error :  Can't locate object
> method "applications" via package "DBIx::Class::ResultSet"

The result of $rowUser->groups is a DBIx::Class::ResultSet...so it's a
collection of your "groups", not an actual "group".  You can only call
ResultSet methods on it like, next, and count.  If you want to get to
your actual group object, which is where you can then call
"applications", you need to address the actual result object.  e.g.
my $groups = $rowUser->groups;
while ( my $group = $groups->next ) {
   my $applications = $group->applications;
    while ( my $app = $applications->next ) {
       # doing awesome app stuff
   }
}

Hope that helps.

- jon

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to