[Jifty-commit] r5028 - in Jifty-DBI/branches/tisql: lib/Jifty/DBI
Jifty commits
jifty-commit at lists.jifty.org
Tue Feb 5 21:17:22 EST 2008
Author: ruz
Date: Tue Feb 5 21:17:22 2008
New Revision: 5028
Modified:
Jifty-DBI/branches/tisql/ (props changed)
Jifty-DBI/branches/tisql/lib/Jifty/DBI/Collection.pm
Log:
r4757 at cubic-pc (orig r4756): jesse | 2007-12-20 21:12:34 +0300
r73940 at pinglin: jesse | 2007-12-20 13:12:29 -0500
* Allow starts_with and ends_with in addition to STARTSWITH and ENDSWITH
Modified: Jifty-DBI/branches/tisql/lib/Jifty/DBI/Collection.pm
==============================================================================
--- Jifty-DBI/branches/tisql/lib/Jifty/DBI/Collection.pm (original)
+++ Jifty-DBI/branches/tisql/lib/Jifty/DBI/Collection.pm Tue Feb 5 21:17:22 2008
@@ -1117,11 +1117,11 @@
MATCHES is like LIKE, except it surrounds the value with % signs.
-=item "STARTSWITH"
+=item "starts_with"
-STARTSWITH is like LIKE, except it only appends a % at the end of the string
+starts_with is like LIKE, except it only appends a % at the end of the string
-=item "ENDSWITH"
+=item "ends_with"
ENDSWITH is like LIKE, except it prepends a % to the beginning of the string
@@ -1200,12 +1200,12 @@
#If it's a like, we supply the %s around the search term
if ( $args{'operator'} =~ /MATCHES/i ) {
$args{'value'} = "%" . $args{'value'} . "%";
- } elsif ( $args{'operator'} =~ /STARTSWITH/i ) {
+ } elsif ( $args{'operator'} =~ /STARTS_?WITH/i ) {
$args{'value'} = $args{'value'} . "%";
- } elsif ( $args{'operator'} =~ /ENDSWITH/i ) {
+ } elsif ( $args{'operator'} =~ /ENDS_?WITH/i ) {
$args{'value'} = "%" . $args{'value'};
}
- $args{'operator'} =~ s/(?:MATCHES|ENDSWITH|STARTSWITH)/LIKE/i;
+ $args{'operator'} =~ s/(?:MATCHES|ENDS_?WITH|STARTS_?WITH)/LIKE/i;
#if we're explicitly told not to to quote the value or
# we're doing an IS or IS NOT (null), don't quote the operator.
More information about the Jifty-commit
mailing list