Browse files

add Like-R and Like-L operators

  • Loading branch information...
1 parent 64eb38a commit 200545235b050ce9cbe95e75d1e254401d9ff323 @zoghal committed Dec 9, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Cake/Controller/Controller.php
View
8 lib/Cake/Controller/Controller.php
@@ -999,7 +999,13 @@ public function postConditions($data = array(), $op = null, $bool = 'AND', $excl
if ($fieldOp === 'LIKE') {
$key = $key.' LIKE';
$value = '%'.$value.'%';
- } elseif ($fieldOp && $fieldOp != '=') {
+ } elseif ( $fieldOp === 'LIKE-R' ){
+ $key = $key.' LIKE';
+ $value = $value.'%';
+ } elseif ( $fieldOp === 'LIKE-L' ){
+ $key = $key.' LIKE';
+ $value = '%'.$value;
+ } elseif ($fieldOp && $fieldOp != '=') {
$key = $key.' '.$fieldOp;
}
$cond[$key] = $value;

0 comments on commit 2005452

Please sign in to comment.