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;
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) = @_;
my $cloned = Rose::DB::Object::Helpers::clone_and_reset($item);
$cloned->requirement_spec_id($self->id);
$cloned->position(undef);
+ $cloned->fb_number(undef) if $params->{paste_template};
$cloned->children(map { $clone_item->($_) } @{ $item->children });
$id_to_clone{ $item->id } = $cloned;