[Catalyst] Using a model class from other class

Nicholas Wehr catalyst at bionikchickens.com
Thu Sep 29 17:36:31 GMT 2011


perhaps a simple way:

my $rs =3D $c->model("DB::Group")->all;
while (my $group =3D $rs->next) {
       for my $user ($ group->users ) {
     # do stuff
       }
}

On Thu, Sep 29, 2011 at 10:04 AM, linuxsupport <lin.support at gmail.com>wrote:

> 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: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110929/6e66d=
41d/attachment.htm


More information about the Catalyst mailing list