-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed escape character in like condition
- Loading branch information
1 parent
6b0e466
commit b628a1c
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* @link http://www.yiiframework.com/ | ||
* @copyright Copyright (c) 2008 Yii Software LLC | ||
* @license http://www.yiiframework.com/license/ | ||
*/ | ||
|
||
namespace edgardmessias\db\firebird\conditions; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
class LikeConditionBuilder extends \yii\db\conditions\LikeConditionBuilder | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected $escapeCharacter = '\\'; | ||
|
||
/** | ||
* `\` is initialized in [[buildLikeCondition()]] method since | ||
* we need to choose replacement value based on [[\yii\db\Schema::quoteValue()]]. | ||
* {@inheritdoc} | ||
*/ | ||
protected $escapingReplacements = [ | ||
'%' => '\%', | ||
'_' => '\_', | ||
'\\' => '\\\\', | ||
]; | ||
} |