class => 'SL::DB::RequirementSpecOrder',
column_map => { id => 'requirement_spec_id' },
},
+ parts => {
+ type => 'one to many',
+ class => 'SL::DB::RequirementSpecPart',
+ column_map => { id => 'requirement_spec_id' },
+ },
);
__PACKAGE__->meta->initialize;
return \@copies;
}
+sub parts_sorted {
+ my ($self, @rest) = @_;
+
+ croak "This sub is not a writer" if @rest;
+
+ return [ sort { $a->position <=> $b->position } @{ $self->parts } ];
+}
+
sub create_copy {
my ($self, %params) = @_;
given then only the text blocks belonging to that C<output_position>
are returned.
+=item C<parts_sorted>
+
+Returns an array reference of additional parts sorted by their
+positional column in ascending order.
+
=item C<validate>
Validate values before saving. Returns list or human-readable error