Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public function find($type = 'first', $params = array(),$cacheParams = array()){
$doQuery =true;
if( isset($cacheParams['cache']) && !empty($cacheParams['cache'])){
$cacheConfig = null;
if(isset($cacheParams['cacheConfig']) && !empty($cacheParams['cacheConfig'])){
$cacheConfig = $cacheParams['cacheConfig'];
$cacheName = $this->name.'-'.$cacheParams['cache'];
$data = Cache::read($cacheName,$cacheConfig);
if($data == false){
$data = parent::find($type,$params);
$doQuery = false;
$data = parent::find($type,$params);
return $data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.