Last active
June 21, 2019 16:09
-
-
Save irzhywau/bb099b322545c25748927444f25b8fe5 to your computer and use it in GitHub Desktop.
Retrieving data from cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this piece is wrapped in a method of the class in charge of handling data to / from cache | |
$this->bootCollection(); | |
$dataset = $this->fetch($this->appViewStoragePath."{$app_id}-{$this->table->key}.json", true); | |
// --- Filter data (settings-based filters) | |
$dataset = $this->applyFilterAndSearch($dataset, $this->searchFilter); | |
// --- Filter data (user filters) | |
$dataset = $this->applyFilterAndSearch($dataset, array_get($state, 'filtered', [])); | |
// --- all the rest: sorting, paginate before output the data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment