X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/687a09d87aee39ab016bf2ec410da006f5044bc4..fb692c5f36d073818aec001f281a70a77dfb6977:/SL/DB/RequirementSpec.pm diff --git a/SL/DB/RequirementSpec.pm b/SL/DB/RequirementSpec.pm index cd1c837f6..72651a3c3 100644 --- a/SL/DB/RequirementSpec.pm +++ b/SL/DB/RequirementSpec.pm @@ -27,6 +27,11 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::RequirementSpec', column_map => { id => 'working_copy_id' }, }, + orders => { + type => 'one to many', + class => 'SL::DB::RequirementSpecOrder', + column_map => { id => 'requirement_spec_id' }, + }, ); __PACKAGE__->meta->initialize; @@ -71,6 +76,13 @@ sub sections_sorted { sub sections { §ions_sorted; } +sub orders_sorted { + my ($self, %params) = _hashify(1, @_); + my $by = $params{by} || 'itime'; + + return [ sort { $a->$by cmp $b->$by } @{ $self->orders } ]; +} + sub displayable_name { my ($self) = @_;