[Dbix-class] many_to_many
Lee Goddard
Lee.Goddard at bbc.co.uk
Tue Sep 5 14:21:43 CEST 2006
Hi there
I'm new to DBIx::Class, and am having problems understanding the syntax
of many_to_may relationshiops.
I have spent some times finding and reading the various docs but get
stuck with (from Cookbook):
__PACKAGE__->has_many('user_address' => 'My::UserAddress', 'user');
__PACKAGE__->many_to_many('addresses' => 'user_address', 'address');
Is the following reading correct?
__PACKAGE__->has_many(
$table_name, $tables_object, $primary_key
);
__PACKAGE__->many_to_many(
$table_name, $table_name_from_has_many, $primary_key
);
If it is, I have other problems...!
Thanks in anticipation
Lee
More information about the Dbix-class
mailing list