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.
 
   4 package SL::DB::PartsGroup;
 
   8 use SL::DB::MetaSetup::PartsGroup;
 
   9 use SL::DB::Manager::PartsGroup;
 
  10 use SL::DB::Helper::ActsAsList;
 
  12 __PACKAGE__->meta->add_relationship(
 
  13   custom_variable_configs => {
 
  14     type                  => 'many to many',
 
  15     map_class             => 'SL::DB::CustomVariableConfigPartsgroup',
 
  18     type         => 'one to many',
 
  19     class        => 'SL::DB::Part',
 
  20     column_map   => { id => 'partsgroup_id' },
 
  24 __PACKAGE__->meta->initialize;
 
  26 sub displayable_name {
 
  29   return join ' ', grep $_, $self->id, $self->partsgroup;
 
  34   require SL::DB::Customer;
 
  38   push @errors, $::locale->text('The description is missing.') if $self->id and !$self->partsgroup;
 
  45   die 'not an accessor' if @_ > 1;
 
  47   return 1 unless $self->id;
 
  51     SL::DB::CustomVariableConfigPartsgroup
 
  54   for my $class (@relations) {
 
  55     eval "require $class";
 
  56     return 0 if $class->_get_manager_class->get_all_count(query => [ partsgroup_id => $self->id ]);