+ push @cond, \%cond_for_obj;
+ }
+ my %cond = ( -not => [@cond] );
+
+ #warn "\tCOND: " . Dumper(\%cond);
+ my $rs_rel_delist = $object->$name->search_rs( \%cond );
+
+ #my $rel_delist_cnt = $rs_rel_delist->count;
+ my @foo = $rs_rel_delist->all;
+ if ( $if_not_submitted eq 'delete' ) {
+
+ #warn "\tdeleting related rows: $rel_delist_cnt\n";
+ $rs_rel_delist->delete;
+
+ # # only handles related result classes with single primary keys
+ # if ( 1 == $rel_col_cnt ) {
+ # $object->$name->search(
+ # { $rel_cols[0] =>
+ # { -not_in => [ map ( $_->id, @updated_objs ) ] }
+ # }
+ # )->delete;
+ # }
+ # else {
+ # warn "multi-column relationships aren't supported\n";
+ # }
+ }
+ elsif ( $if_not_submitted eq 'set_to_null' ) {
+
+ #warn "\tnullifying related rows: $rel_delist_cnt\n";
+ my %update = map { $_ => undef } @rel_cols;
+ $rs_rel_delist->update( \%update );
+
+ # # only handles related result classes with single primary keys
+ # if ( 1 == $rel_col_cnt ) {
+ # $object->$name->search(
+ # { $rel_cols[0] =>
+ # { -not_in => [ map ( $_->id, @updated_objs ) ] }
+ # }
+ # )->update( { $rel_cols[0] => undef } );
+ # }
+ # else {
+ # warn "multi-column relationships aren't supported\n";
+ # }