[Dbix-class] using HasMany with object references

Justin Guenther jguenther at gmail.com
Tue Dec 6 01:16:30 CET 2005


On 12/5/05, Matt S Trout <dbix-class at trout.me.uk> wrote:

> Maybe I should have said $belongs_to_rel to clarify the metasyntactic
> variable


Ahh, that makes sense. It looks like it's working now, thanks.

> Here's my setup code:
> >
> > In the class Treatment: (which has_many Phases)
> > ...
> > __PACKAGE__->has_many('phases' => 'SaskSAGE::Model::DBIC::Phase',
> >                       'treatment_id');
> > ...
> >
> > In the class Phase: (which belongs_to Treatment)
> >
> > ...
> > __PACKAGE__->belongs_to('treatment_id' =>
> > 'SaskSAGE::Model::DBIC::Treatment');
> > ...
> >
> > I'm trying to add a phase to a treatment by calling
> >
> > $phase->belongs_to_rel($treatment);
> >
> > but this method does not exist.
>
> $phase->treatment_id($treatment);
>
> --
>      Matt S Trout       Offering custom development, consultancy and
> support
>   Technical Director    contracts for Catalyst, DBIx::Class and BAST.
> Contact
> Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more
> information
>
> + Help us build a better perl ORM:
> http://dbix-class.shadowcatsystems.co.uk/ +
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20051205/12516967/attachment.htm


More information about the Dbix-class mailing list