Allow RLIKE in conditions.

This commit is contained in:
euromark 2014-11-26 19:56:58 +01:00
parent 21b52335e5
commit d0f75a03af
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'
)));