Skip to content

Commit 79d65f4

Browse files
committed
Fix failing test, criteria are constructed in an invalid way
1 parent a0be018 commit 79d65f4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/source/index.html.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ $table->createAdapter(ORMAdapter::class, [
285285
'entity' => Employee::class,
286286
'criteria' => [
287287
function (QueryBuilder $builder) {
288-
$builder->andWhere(new Comparison('c.name', Comparison::CONTAINS, 'ny 2'));
288+
$builder->andWhere($builder->expr()->like('c.name', ':test'))->setParameter('test', '%ny 2%');
289289
},
290290
new SearchCriteriaProvider(),
291291
],

tests/Fixtures/AppBundle/DataTable/Type/CustomQueryTableType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public function configure(DataTable $dataTable, array $options)
5050
;
5151
},
5252
'criteria' => function (QueryBuilder $builder) {
53-
$builder->andWhere(new Comparison('c.name', Comparison::CONTAINS, 'ny 2'));
53+
$builder->andWhere($builder->expr()->like('c.name', ':test'))->setParameter('test', '%ny 2%');
54+
//$builder->addCriteria(Criteria::create()->andWhere(new Comparison('c.name', Comparison::CONTAINS, 'ny 2')));
5455
},
5556
])
5657
;

0 commit comments

Comments
 (0)