cvs commit: p5ee/App-Repository/lib/App/ValueDomain Repository.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     05/09/16 12:51:57

  Modified:    App-Repository/lib/App/ValueDomain Repository.pm
  Log:
  add sorting (order_by)
  
  Revision  Changes    Path
  1.5       +6 -2      p5ee/App-Repository/lib/App/ValueDomain/Repository.pm
  
  Index: Repository.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Repository/lib/App/ValueDomain/Repository.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Repository.pm	16 Sep 2005 19:43:11 -0000	1.4
  +++ Repository.pm	16 Sep 2005 19:51:57 -0000	1.5
  @@ -128,7 +128,11 @@
           if ($rep && $table && $valuecolumn && $params) {
               my @cols = ( $valuecolumn );
               push(@cols, $labelcolumn) if ($labelcolumn);
  -            $rows   = $rep->get_rows($table, \%params, \@cols);
  +            my ($options);
  +            if ($self->{order_by}) {
  +                $options = { order_by => $self->{order_by} };
  +            }
  +            $rows   = $rep->get_rows($table, \%params, \@cols, $options);
               $values = [];
               $labels = {};
               if ($self->{extra_values}) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.