Final Class Yiisoft\Db\Mssql\Builder\LikeBuilder
| Inheritance | Yiisoft\ |
|---|
Build an object of {@see LikeCondition} into SQL expressions for MSSQL Server.
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $escapingReplacements | array | Map of chars to their replacements in LIKE conditions. |
Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| build() | Yiisoft\ |
Property Details
Map of chars to their replacements in LIKE conditions. By default, it's configured to escape
%, _, [ with ], \\.
protected array $escapingReplacements = [
'%' => '[%]',
'_' => '[_]',
'[' => '[[]',
']' => '[]]',
'\\' => '[\]',
]
'%' => '[%]',
'_' => '[_]',
'[' => '[[]',
']' => '[]]',
'\\' => '[\]',
]
Method Details
| public string build ( \ | ||
| $expression | \ |
|
| $params | array | |
public function build(ExpressionInterface $expression, array &$params = []): string
{
if ($expression->caseSensitive === true) {
throw new NotSupportedException('MSSQL doesn\'t support case-sensitive "LIKE" conditions.');
}
return parent::build($expression, $params);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.