kivitendo/SL/DB/OrderStatus.pm @ c123e944
5b7e8b46 | Bernd Bleßmann | # This file has been auto-generated only because it didn't exist.
|
||
# Feel free to modify it at will; it will not be overwritten automatically.
|
||||
package SL::DB::OrderStatus;
|
||||
use strict;
|
||||
use SL::DB::MetaSetup::OrderStatus;
|
||||
use SL::DB::Manager::OrderStatus;
|
||||
75770330 | Bernd Bleßmann | use SL::DB::Helper::ActsAsList;
|
||
5b7e8b46 | Bernd Bleßmann | __PACKAGE__->meta->initialize;
|
||
75770330 | Bernd Bleßmann | sub validate {
|
||
my ($self) = @_;
|
||||
my @errors;
|
||||
push @errors, $::locale->text('The name is missing.') if !$self->name;
|
||||
my $not_unique_count = SL::DB::Manager::OrderStatus->get_all_count(where => ['!id' => $self->id,
|
||||
name => $self->name]);
|
||||
push @errors, $::locale->text('The name is not unique.') if $not_unique_count;
|
||||
return @errors;
|
||||
}
|
||||
5b7e8b46 | Bernd Bleßmann | 1;
|