Skip to content

Commit fc68f1c

Browse files
author
Viktor Masicek
committed
Merge remote-tracking branch 'origin/f-set-data' into nette-3
# Conflicts: # src/QueryObjectDataSource.php
2 parents b556ff4 + af03c01 commit fc68f1c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/QueryObjectDataSource.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class QueryObjectDataSource implements IDataSource {
3333
/** @var callable */
3434
public $limitCallback;
3535

36+
/** @var array */
37+
private $data;
38+
3639
/**
3740
* @param \Kdyby\Doctrine\QueryObject $queryObject
3841
* @param \Kdyby\Doctrine\EntityRepository $repo
@@ -105,9 +108,21 @@ public function getCount(): int {
105108
* @return array
106109
*/
107110
public function getData(): array {
111+
if ($this->data) {
112+
return $this->data;
113+
}
108114
return $this->getResultSet()->toArray();
109115
}
110116

117+
/**
118+
* Set the data
119+
* @return $this
120+
*/
121+
public function setData($data) {
122+
$this->data = $data;
123+
return $this;
124+
}
125+
111126
/**
112127
* Filter data
113128
* @param array $filters

0 commit comments

Comments
 (0)