Skip to content

Commit be612a8

Browse files
bijicurry684
authored andcommitted
test compat
1 parent e4ad909 commit be612a8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Adapter/Doctrine/ORM/SearchCriteriaProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private function processGlobalSearch(QueryBuilder $queryBuilder, DataTableState
6161
$expr = $queryBuilder->expr();
6262
$comparisons = $expr->orX();
6363
foreach ($state->getDataTable()->getColumns() as $column) {
64-
if ($column->isGlobalSearchable() && !empty($field = $column->getField()) && $column->isValidForSearch($globalSearch)) {
64+
if ($column->isGlobalSearchable() && !empty($column->getField()) && $column->isValidForSearch($globalSearch)) {
6565
$comparisons->add(new Comparison($column->getLeftExpr(), $column->getOperator(),
6666
$expr->literal($column->getRightExpr($globalSearch))));
6767
}

src/Column/TextColumn.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ protected function configureOptions(OptionsResolver $resolver)
3838
{
3939
parent::configureOptions($resolver);
4040

41+
$resolver
42+
->setDefault('operator', 'LIKE')
43+
->setDefault(
44+
'rightExpr',
45+
function ($value) {
46+
return '%' . $value . '%';
47+
}
48+
);
49+
4150
$resolver
4251
->setDefault('raw', false)
4352
->setAllowedTypes('raw', 'bool')

0 commit comments

Comments
 (0)