mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Allow RLIKE in conditions.
This commit is contained in:
parent
21b52335e5
commit
d0f75a03af
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
)));
|
||||
|
|
Loading…
Add table
Reference in a new issue