[svn:p5ee] r3603 - p5ee/trunk/App-Repository/lib/App/Repository

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
Author: spadkins
Date: Sat Mar  4 21:13:04 2006
New Revision: 3603

Modified:
   p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm

Log:
direction hash may be more general than just asc/desc (up/down)

Modified: p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	(original)
+++ p5ee/trunk/App-Repository/lib/App/Repository/DBI.pm	Sat Mar  4 21:13:04 2006
@@ -791,10 +791,10 @@
             else {
                 $dir = "";
                 if ($direction && ref($direction) eq "HASH" && defined $direction->{$col}) {
-                    if ($direction->{$col} =~ /^asc$/i) {
+                    if ($direction->{$col} =~ /^[au]/i) {  # asc, up, etc.
                         $dir = " asc";
                     }
-                    elsif ($direction->{$col} =~ /^desc$/i) {
+                    elsif ($direction->{$col} =~ /^d/i) {
                         $dir = " desc";
                     }
                 }
@@ -1081,10 +1081,10 @@
                 }
                 else {
                     if ($direction && ref($direction) eq "HASH" && defined $direction->{$column}) {
-                        if ($direction->{$column} =~ /^asc$/i) {
+                        if ($direction->{$column} =~ /^[au]/i) {
                             $order_by_dbexpr .= " asc";
                         }
-                        elsif ($direction->{$column} =~ /^desc$/i) {
+                        elsif ($direction->{$column} =~ /^d/i) {
                             $order_by_dbexpr .= " desc";
                         }
                     }
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.