From: "linuxsupport" <[email protected]>
> Hi,
> 
> I have a model called DB where I have 3 classes, User, Group, UserGroup
> 
> Now, I have created a resultset for Group ie.
> Myapp::Schema::ResultSet::Group
> 
> How can I call User class from Myapp::Schema::ResultSet::Group ?
> 
> For example In Group resultset I am working with some groups and want to
> fetch all the users, is it possible?
>


--------------------------------------------------------------------------------


> _______________________________________________
> List: [email protected]



Although it is off-topic...

Yes, you can do that:

package Myapp::Schema::ResultSet::Group;

use parent 'DBIx::Class::ResultSet';

sub some_method {
    my ( $self ) = @_;

    my $users = $self->result_source->schema->resultset( 'User' );

}

Octavian


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to