Skip to content

Commit 193530c

Browse files
authored
Changes CollectionView to accept ResultSetInterface (#110)
1 parent 667d75e commit 193530c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/collection-view/src/Serializer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
use Adbar\Dot;
77
use Cake\Core\Configure;
8+
use Cake\Datasource\ResultSetInterface;
89
use Cake\Http\ServerRequest;
9-
use Cake\ORM\ResultSet;
1010
use Cake\Utility\Xml;
1111
use Cake\View\Helper\PaginatorHelper;
1212
use RuntimeException;
@@ -49,7 +49,7 @@ public function __construct(mixed $serialize, ?ServerRequest $request = null, ?P
4949
$this->paginator = $paginator;
5050
$this->config = Configure::read('CollectionView');
5151

52-
if ($serialize instanceof ResultSet) {
52+
if ($serialize instanceof ResultSetInterface) {
5353
$this->data = $this->collection($serialize);
5454
} else {
5555
$this->data = $serialize;
@@ -96,10 +96,10 @@ public function getData(): mixed
9696
}
9797

9898
/**
99-
* @param \Cake\ORM\ResultSet $resultSet the data to be converted into a HAL array
99+
* @param \Cake\Datasource\ResultSetInterface $resultSet the data to be converted into a HAL array
100100
* @return array
101101
*/
102-
private function collection(ResultSet $resultSet): array
102+
private function collection(ResultSetInterface $resultSet): array
103103
{
104104
$dot = new Dot();
105105
foreach ($this->config as $key => $value) {

0 commit comments

Comments
 (0)