Skip to content

Commit db13f06

Browse files
committed
dodelavky
1 parent de11f6c commit db13f06

3 files changed

Lines changed: 15 additions & 23 deletions

File tree

composer.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
{
22
"name": "adt/query-object-data-source",
3-
"description": "Ublaboo Datagrid data source bindings for Kdyby Doctrine query objects.",
3+
"description": "Ublaboo Datagrid data source bindings for adt/doctrine-components query objects.",
44
"type": "library",
55
"license": [
6-
"MIT",
7-
"BSD-3-Clause",
8-
"GPL-2.0",
9-
"GPL-3.0"
6+
"MIT"
107
],
118
"require": {
12-
"php": ">=7.1"
13-
},
14-
"require-dev": {
15-
"kdyby/doctrine": "^3.1 || ~4.0",
16-
"ublaboo/datagrid": "^5.0 || ~6.0",
17-
"nette/utils": "^2.4 || ~3.0",
18-
"nette/di": "^2.4 || ~3.0"
9+
"php": ">=7.4",
10+
"adt/base-query": "^2.0",
11+
"ublaboo/datagrid": "^6.0",
12+
"nette/di": "^2.4|^3.0"
1913
},
2014
"autoload": {
2115
"psr-4": {

src/IQueryObjectDataSourceFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
interface IQueryObjectDataSourceFactory {
66

77
/**
8-
* @param \ADT\BaseQuery\QueryObject $queryObject
8+
* @param \ADT\DoctrineComponents\QueryObject $queryObject
99
* @param \Doctrine\ORM\EntityRepository|null $repo
1010
* @return QueryObjectDataSource
1111
*/
12-
function create(\ADT\BaseQuery\QueryObject $queryObject, \Doctrine\ORM\EntityRepository $repo = null);
12+
function create(\ADT\DoctrineComponents\QueryObject $queryObject, \Doctrine\ORM\EntityRepository $repo = null);
1313

1414
}

src/QueryObjectDataSource.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
use Ublaboo\DataGrid\Utils\DateTimeHelper;
1010
use Ublaboo\DataGrid\DataSource\IDataSource;
1111

12-
class QueryObjectDataSource implements IDataSource {
13-
14-
use \Nette\SmartObject;
15-
16-
/** @var \ADT\BaseQuery\ResultSet */
12+
class QueryObjectDataSource implements IDataSource
13+
{
14+
/** @var \ADT\DoctrineComponents\ResultSet */
1715
protected $resultSet;
1816

1917
/** @var \Doctrine\ORM\EntityRepository */
2018
protected $repo;
2119

22-
/** @var \ADT\BaseQuery\QueryObject|IQueryObject */
20+
/** @var \ADT\DoctrineComponents\QueryObject|IQueryObject */
2321
protected $queryObject;
2422

2523
/** @var callable */
@@ -39,11 +37,11 @@ class QueryObjectDataSource implements IDataSource {
3937

4038
/**
4139
* QueryObjectDataSource constructor.
42-
* @param \ADT\BaseQuery\QueryObject $queryObject
40+
* @param \ADT\DoctrineComponents\QueryObject $queryObject
4341
* @param \Doctrine\ORM\EntityRepository|null $repo
4442
* @throws \Exception
4543
*/
46-
public function __construct(\ADT\BaseQuery\QueryObject $queryObject, \Doctrine\ORM\EntityRepository $repo = null)
44+
public function __construct(\ADT\DoctrineComponents\QueryObject $queryObject, \Doctrine\ORM\EntityRepository $repo = null)
4745
{
4846
if (!$repo && (!$queryObject instanceof IQueryObject)) {
4947
throw new \Exception('"repo" must be set or "queryObject" has to implement IQueryObject interface.');
@@ -173,7 +171,7 @@ public function filterOne(array $filter): IDataSource {
173171
* @param int $limit
174172
* @return static
175173
*/
176-
public function limit($offset, $limit): IDataSource {
174+
public function limit(int $offset, int $limit): IDataSource {
177175
$defaultCallback = function () use ($offset, $limit) {
178176
$this->getResultSet()->applyPaging($offset, $limit);
179177
};

0 commit comments

Comments
 (0)