Pflichtenhefte: Datenbankschema und Rose-DB-Models
[kivitendo-erp.git] / SL / DB / RequirementSpec.pm
1 package SL::DB::RequirementSpec;
2
3 use strict;
4
5 use SL::DB::MetaSetup::RequirementSpec;
6 use SL::Locale::String;
7
8 __PACKAGE__->meta->add_relationship(
9   items          => {
10     type         => 'one to many',
11     class        => 'SL::DB::RequirementSpecItem',
12     column_map   => { id => 'requirement_spec_id' },
13   },
14   text_blocks    => {
15     type         => 'one to many',
16     class        => 'SL::DB::RequirementSpecTextBlock',
17     column_map   => { id => 'requirement_spec_id' },
18   },
19 );
20
21 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
22 __PACKAGE__->meta->make_manager_class;
23
24 __PACKAGE__->meta->initialize;
25
26 sub validate {
27   my ($self) = @_;
28
29   my @errors;
30   push @errors, t8('The title is missing.') if !$self->title;
31
32   return @errors;
33 }
34
35 1;