]> wagnertech.de Git - mfinanz.git/blob - SL/DB/OrderStatus.pm
kivitendo 3.9.2-0.2
[mfinanz.git] / SL / DB / OrderStatus.pm
1 # This file has been auto-generated only because it didn't exist.
2 # Feel free to modify it at will; it will not be overwritten automatically.
3
4 package SL::DB::OrderStatus;
5
6 use strict;
7
8 use SL::DB::MetaSetup::OrderStatus;
9 use SL::DB::Manager::OrderStatus;
10
11 use SL::DB::Helper::ActsAsList;
12
13 __PACKAGE__->meta->initialize;
14
15 sub validate {
16   my ($self) = @_;
17
18   my @errors;
19   push @errors, $::locale->text('The name is missing.') if !$self->name;
20
21   my $not_unique_count = SL::DB::Manager::OrderStatus->get_all_count(where => ['!id' => $self->id,
22                                                                                name  => $self->name]);
23   push @errors, $::locale->text('The name is not unique.') if $not_unique_count;
24
25   return @errors;
26 }
27
28 1;