File tree 4 files changed +31
-0
lines changed
4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 32
32
- New #379 : Add parameters ` $ifExists ` and ` $cascade ` to ` CommandInterface::dropTable() ` and
33
33
` DDLQueryBuilderInterface::dropTable() ` methods (@vjik )
34
34
- Chg #382 : Remove ` yiisoft/json ` dependency (@Tigrov )
35
+ - New #383 : Add ` caseSensitive ` option to like condition (@vjik )
35
36
36
37
## 1.2.0 March 21, 2024
37
38
Original file line number Diff line number Diff line change 4
4
5
5
use Rector \CodeQuality \Rector \Class_ \InlineConstructorDefaultToPropertyRector ;
6
6
use Rector \Config \RectorConfig ;
7
+ use Rector \DeadCode \Rector \StaticCall \RemoveParentCallWithoutParentRector ;
7
8
use Rector \Php81 \Rector \FuncCall \NullToStrictStringFuncCallArgRector ;
8
9
use Rector \Php81 \Rector \Property \ReadOnlyPropertyRector ;
9
10
use Rector \Set \ValueObject \LevelSetList ;
30
31
$ rectorConfig ->skip ([
31
32
NullToStrictStringFuncCallArgRector::class,
32
33
ReadOnlyPropertyRector::class,
34
+ RemoveParentCallWithoutParentRector::class,
33
35
]);
34
36
};
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Yiisoft \Db \Mysql \Builder ;
6
+
7
+ use Yiisoft \Db \QueryBuilder \Condition \Interface \LikeConditionInterface ;
8
+
9
+ /**
10
+ * Build an object of {@see LikeConditionInterface} into SQL expressions for MySQL Server.
11
+ */
12
+ final class LikeConditionBuilder extends \Yiisoft \Db \QueryBuilder \Condition \Builder \LikeConditionBuilder
13
+ {
14
+ protected function prepareColumn (LikeConditionInterface $ expression , array &$ params ): string
15
+ {
16
+ $ column = parent ::prepareColumn ($ expression , $ params );
17
+
18
+ if ($ expression ->getCaseSensitive () === true ) {
19
+ $ column = 'BINARY ' . $ column ;
20
+ }
21
+
22
+ return $ column ;
23
+ }
24
+ }
Original file line number Diff line number Diff line change 8
8
use Yiisoft \Db \Expression \ExpressionInterface ;
9
9
use Yiisoft \Db \Mysql \Builder \ExpressionBuilder ;
10
10
use Yiisoft \Db \Mysql \Builder \JsonOverlapsConditionBuilder ;
11
+ use Yiisoft \Db \Mysql \Builder \LikeConditionBuilder ;
11
12
use Yiisoft \Db \QueryBuilder \AbstractDQLQueryBuilder ;
12
13
use Yiisoft \Db \QueryBuilder \Condition \JsonOverlapsCondition ;
13
14
15
+ use Yiisoft \Db \QueryBuilder \Condition \LikeCondition ;
16
+
14
17
use function ctype_digit ;
15
18
16
19
/**
@@ -83,6 +86,7 @@ protected function defaultExpressionBuilders(): array
83
86
...parent ::defaultExpressionBuilders (),
84
87
JsonOverlapsCondition::class => JsonOverlapsConditionBuilder::class,
85
88
Expression::class => ExpressionBuilder::class,
89
+ LikeCondition::class => LikeConditionBuilder::class,
86
90
];
87
91
}
88
92
}
You can’t perform that action at this time.
0 commit comments