X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FRequirementSpecItem.pm;h=35acefcb6acb98fd09951313f746e3cbeb20bb95;hb=3bbe01f72076071001aee77c1c8b9bce00c6d7c2;hp=641982cf1b2bb79e6f90d92277c158324256f274;hpb=84fc52bdc02b7b84f7a644cf2bed484f1213d9ce;p=kivitendo-erp.git diff --git a/SL/DB/RequirementSpecItem.pm b/SL/DB/RequirementSpecItem.pm index 641982cf1..35acefcb6 100644 --- a/SL/DB/RequirementSpecItem.pm +++ b/SL/DB/RequirementSpecItem.pm @@ -41,7 +41,7 @@ __PACKAGE__->configure_acts_as_list(group_by => [qw(requirement_spec_id parent_i __PACKAGE__->attr_duration(qw(time_estimation)); __PACKAGE__->before_save(\&_before_save_create_fb_number); -__PACKAGE__->before_save(\ &_before_save_invalidate_requirement_spec_version); +__PACKAGE__->before_save(\&_before_save_invalidate_requirement_spec_version); __PACKAGE__->before_delete(\&_before_delete_invalidate_requirement_spec_version); sub _before_save_create_fb_number { @@ -104,8 +104,7 @@ sub children_sorted { croak "Not a writer" if @args; - my @children = sort { $a->position <=> $b->position } $self->children; - return wantarray ? @children : \@children; + return [ sort { $a->position <=> $b->position } $self->children ]; } sub section { @@ -126,3 +125,51 @@ sub child_type { } 1; +__END__ + +=pod + +=encoding utf8 + +=head1 NAME + +SL::DB::RequirementSpecItem - Items for requirement specs + +=head1 OVERVIEW + +Please see L for the architectual overview. + +=head1 FUNCTIONS + +=over 4 + +=item C + +Returns the C for children of C<$self>. + +=item C + +Returns an array reference of direct children (not of grandchildren) +for C<$self> ordered by their positional column in ascending order. + +=item C
+ +Returns the section this item belongs to. It can be C<$self> if +C<$self> is already a section, its parent or grandparent. + +=item C + +Validates before saving and returns an array of human-readable error +messages in case of an error. + +=back + +=head1 BUGS + +Nothing here yet. + +=head1 AUTHOR + +Moritz Bunkus Em.bunkus@linet-services.deE + +=cut