Merge pull request #5270 from cakephp/2.6-rlike

Allow RLIKE in conditions.
This commit is contained in:
Mark Story 2014-11-26 17:00:32 -05:00
commit 868f5047ec
2 changed files with 5 additions and 1 deletions

View file

@ -181,7 +181,7 @@ class DboSource extends DataSource {
*
* @var array
*/
protected $_sqlOps = array('like', 'ilike', 'or', 'not', 'in', 'between', 'regexp', 'similar to');
protected $_sqlOps = array('like', 'ilike', 'rlike', 'or', 'not', 'in', 'between', 'regexp', 'similar to');
/**
* Indicates the level of nested transactions

View file

@ -2384,6 +2384,10 @@ SQL;
$expected = " WHERE ((`User`.`user` = 'mariano') OR (`User`.`user` = 'nate'))";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('User.user RLIKE' => 'mariano|nate'));
$expected = " WHERE `User`.`user` RLIKE 'mariano|nate'";
$this->assertEquals($expected, $result);
$result = $this->Dbo->conditions(array('or' => array(
'score BETWEEN ? AND ?' => array('4', '5'), 'rating >' => '20'
)));