1 | <?php |
||||
2 | |||||
3 | namespace Backend\Core\Engine; |
||||
4 | |||||
5 | use Backend\Core\Engine\Model as BackendModel; |
||||
6 | |||||
7 | /** |
||||
8 | * A datagrid with a database-connection as source |
||||
9 | */ |
||||
10 | class DataGridDatabase extends DataGrid |
||||
11 | { |
||||
12 | /** |
||||
13 | * @param string $query The query to retrieve the data. |
||||
14 | * @param array $parameters The parameters to be used inside the query. |
||||
15 | * @param string $resultsQuery The optional count query, used to calculate the number of results. |
||||
16 | * @param array $resultsParameters The parameters to be used inside the results query. |
||||
17 | */ |
||||
18 | 19 | public function __construct( |
|||
19 | string $query, |
||||
20 | array $parameters = [], |
||||
21 | string $resultsQuery = null, |
||||
22 | array $resultsParameters = [] |
||||
23 | ) { |
||||
24 | 19 | parent::__construct( |
|||
25 | 19 | new \SpoonDatagridSourceDB( |
|||
26 | 19 | BackendModel::get('database'), |
|||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
27 | 19 | [$query, $parameters], |
|||
28 | 19 | $resultsQuery === null ? null : [$resultsQuery, $resultsParameters] |
|||
0 ignored issues
–
show
It seems like
$resultsQuery === null ?...ry, $resultsParameters) can also be of type array<integer,array|string> ; however, parameter $numResultsQuery of SpoonDatagridSourceDB::__construct() does only seem to accept string , maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
29 | ) |
||||
30 | ); |
||||
31 | 19 | } |
|||
32 | } |
||||
33 |