Skip to content

Commit

Permalink
Merge pull request #197 from ThaDafinser/feature/noCache
Browse files Browse the repository at this point in the history
export without cache
  • Loading branch information
ThaDafinser committed Aug 7, 2015
2 parents cf042e7 + 2c3522a commit f8279c7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ZfcDatagrid/Renderer/AbstractRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,13 @@ public function getCacheData()
/**
*
* @throws \Exception
* @return array
* @return array|false
*/
private function getCacheSortConditions()
{
$cacheData = $this->getCacheData();
if (! isset($cacheData['sortConditions'])) {
throw new \Exception('Sort conditions from cache are missing!');
return false;
}

return $cacheData['sortConditions'];
Expand All @@ -347,13 +347,13 @@ private function getCacheSortConditions()
/**
*
* @throws \Exception
* @return array
* @return array|false
*/
private function getCacheFilters()
{
$cacheData = $this->getCacheData();
if (! isset($cacheData['filters'])) {
throw new \Exception('Filters from cache are missing!');
return false;
}

return $cacheData['filters'];
Expand Down Expand Up @@ -493,7 +493,7 @@ public function getSortConditions()
return $this->sortConditions;
}

if ($this->isExport() === true) {
if ($this->isExport() === true && $this->getCacheSortConditions() !== false) {
// Export renderer should always retrieve the sort conditions from cache!
$this->sortConditions = $this->getCacheSortConditions();

Expand Down Expand Up @@ -558,7 +558,8 @@ public function getFilters()
if (is_array($this->filters)) {
return $this->filters;
}
if ($this->isExport() === true) {

if ($this->isExport() === true && $this->getCacheFilters() !== false) {
// Export renderer should always retrieve the filters from cache!
$this->filters = $this->getCacheFilters();

Expand Down

0 comments on commit f8279c7

Please sign in to comment.