initialize in SL::DB::Objects statt im MetaSetup
[kivitendo-erp.git] / SL / DB / CustomVariableConfig.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::CustomVariableConfig;
5
6 use strict;
7
8 use SL::DB::MetaSetup::CustomVariableConfig;
9 use SL::DB::Manager::CustomVariableConfig;
10 use SL::DB::Helper::ActsAsList;
11
12 __PACKAGE__->meta->initialize;
13
14 __PACKAGE__->configure_acts_as_list(group_by => [qw(module)]);
15
16 sub validate {
17   my ($self) = @_;
18
19   my @errors;
20   push @errors, $::locale->text('The name is missing.')        if !$self->name;
21   push @errors, $::locale->text('The description is missing.') if !$self->description;
22   push @errors, $::locale->text('The type is missing.')        if !$self->type;
23   push @errors, $::locale->text('The option field is empty.')  if (($self->type || '') eq 'select') && !$self->options;
24
25   return @errors;
26 }
27
28 1;