diff --git a/src/Kdyby/Doctrine/ResultSet.php b/src/Kdyby/Doctrine/ResultSet.php index 229b3742..b7b36ec0 100644 --- a/src/Kdyby/Doctrine/ResultSet.php +++ b/src/Kdyby/Doctrine/ResultSet.php @@ -41,6 +41,11 @@ class ResultSet extends Nette\Object implements \Countable, \IteratorAggregate */ private $paginatedQuery; + /** + * @var bool + */ + private $fetchJoinCollection = TRUE; + /** @@ -54,6 +59,18 @@ public function __construct(ORM\AbstractQuery $query) + /** + * @param bool $fetchJoinCollection + * @return ResultSet + */ + public function setFetchJoinCollection($fetchJoinCollection) + { + $this->fetchJoinCollection = (bool) $fetchJoinCollection; + return $this; + } + + + /** * @param string|array $columns * @@ -190,7 +207,7 @@ public function count() private function getPaginatedQuery() { if ($this->paginatedQuery === NULL) { - $this->paginatedQuery = new ResultPaginator($this->query); + $this->paginatedQuery = new ResultPaginator($this->query, $this->fetchJoinCollection); } return $this->paginatedQuery;