Revision 3f59726e
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/DB/PartClassification.pm | ||
---|---|---|
use SL::DB::Manager::PartClassification;
|
||
|
||
__PACKAGE__->meta->initialize;
|
||
__PACKAGE__->before_delete('can_be_deleted');
|
||
|
||
# check if the description and abbreviation is present
|
||
#
|
||
... | ... | |
return @errors;
|
||
}
|
||
|
||
sub can_be_deleted {
|
||
my ($self) = @_;
|
||
|
||
# The first five part classifications must not be deleted.
|
||
return defined($self->id) && ($self->id >= 5);
|
||
}
|
||
|
||
1;
|
||
|
Auch abrufbar als: Unified diff
Artikel-Klassifizierung: System-Klassifizierungen (id < 5) nicht löschen können