[Dbix-class] Easy update for has_many?

Paul Makepeace paulm at paulm.com
Wed Aug 22 12:50:05 GMT 2007


I have a standard has_many linking multiple groups profiles to a
particular user,

  My::Schema::User->has_many(user_profile => 'My:Schema::UserProfile',
	{ 'foreign.user_uid' => 'self.uid', } );

UserProfile is the link class ("join") table: user_uid, profile_uid

I'd like to be able to set a bunch of profile_uids and have the ORM
sort out which need deletion and creation. Is this possible?

I looked in the cookbook and there's examples on building the
relationships ({has,many_to}_many) but not much (anything?) on using
them.

P



More information about the DBIx-Class mailing list