Skip to content

Commit a22a285

Browse files
committed
1 parent 4357ccd commit a22a285

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77
],
88
"require": {
99
"php": ">=8.0",
10+
"adt/datagrid-components": "dev-main",
1011
"adt/doctrine-components": "^3.0",
1112
"ublaboo/datagrid": "^6.0|^7.0",
1213
"nette/di": "^2.4|^3.0"
1314
},
15+
"repositories": [
16+
{
17+
"type": "git",
18+
"url": "https://github.com/AppsDevTeam/datagrid-components",
19+
"no-api": true
20+
}
21+
],
1422
"autoload": {
1523
"psr-4": {
1624
"ADT\\QueryObjectDataSource\\": "src/"

src/QueryObjectDataSource.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
namespace ADT\QueryObjectDataSource;
44

5+
use ADT\Datagrid\Filter\FilterCheckbox;
56
use ADT\DoctrineComponents\QueryObject\QueryObject;
67
use ADT\DoctrineComponents\QueryObject\QueryObjectByMode;
8+
use ADT\Datagrid\Filter\FilterSwitcher;
79
use Contributte\Datagrid\DataSource\IDataSource;
810
use Contributte\Datagrid\Exception\DatagridDateTimeHelperException;
911
use DateTime;
@@ -140,6 +142,12 @@ public function filter(array $filters): void
140142
if ($filter->getConditionCallback()) {
141143
call_user_func($filter->getConditionCallback(), $this->queryObject, $filter->getValue());
142144
}
145+
elseif ($filter instanceof FilterCheckbox || $filter instanceof FilterSwitcher) {
146+
$this->queryObject->by(
147+
$filter->getKey(),
148+
$filter->getValue()
149+
);
150+
}
143151
elseif ($filter instanceof FilterText) {
144152
$by = array_keys($filter->getCondition());
145153
$value = $filter->getCondition()[$by[0]];

0 commit comments

Comments
 (0)