Hi all,
I've some confusion about the has_many relationship and how to quickly
update a set of value thru a join table.
I've a class Ticket with has_many Worker, and a join table.
The following works for adding a worker to a ticket:

 for my $current_worker (@workers){
            $ticket->add_to_tickets_workers( { pk_ticket =>
$ticket->pk,
                                               pk_worker =>
$current_worker->pk } ) if ( grep { $current_worker->pk == $_ }
@selected );


However I would like to have a set_tickets_workers behavior, so that I
can pass the array 8ref) of objects I want to substitute on the join
table.
Is there a way to do it or do I have to manually delete join rows (in
such case, how)?

Thanks,
Luca

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to