Revision 7d66fb87
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/DB/RequirementSpecItem.pm | ||
---|---|---|
42 | 42 |
|
43 | 43 |
__PACKAGE__->before_save(\&_before_save_create_fb_number); |
44 | 44 |
__PACKAGE__->before_save(\ &_before_save_invalidate_requirement_spec_version); |
45 |
__PACKAGE__->before_delete(\&_before_delete_delete_children); |
|
46 | 45 |
__PACKAGE__->before_delete(\&_before_delete_invalidate_requirement_spec_version); |
47 | 46 |
|
48 |
sub _before_delete_delete_children { |
|
49 |
my ($self) = @_; |
|
50 |
|
|
51 |
foreach my $child (@{ SL::DB::Manager::RequirementSpecItem->get_all(where => [ parent_id => $self->id ]) }) { |
|
52 |
my $result = $child->delete; |
|
53 |
return $result if !$result; |
|
54 |
} |
|
55 |
|
|
56 |
1; |
|
57 |
} |
|
58 |
|
|
59 | 47 |
sub _before_save_create_fb_number { |
60 | 48 |
my ($self) = @_; |
61 | 49 |
|
Auch abrufbar als: Unified diff
Überflüssigen before_delete-Hook entfernt