Advertisement
Guest User

cakephp cache error

a guest
May 16th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. //Controller    
  2.     public function index(){
  3.         Cache::delete('fiseIndex');
  4.         $fise = Cache::read('fiseIndex');
  5.         if (!$fise) {
  6.             $fise = $this->Fisa->retrieve('all',[],
  7.                 ['User','Client','SalesStatus','BrandModel'=>['Brand']]
  8.             );
  9.             Cache::write($fise,'fiseIndex','verylong');
  10.         }
  11.         $this->set('fise',$fise);
  12.     }
  13.  
  14. //AppModel
  15.     public function retrieve($type = 'list', $conditions = [], $contain = [], $order = []){
  16.         if(!isset($conditions[$this->alias.'.deleted'])){
  17.             $conditions[$this->alias.'.deleted'] = 0;
  18.         }
  19.         return $this->find($type,[
  20.             'conditions' =>$conditions,
  21.             'contain'    =>$contain,
  22.             'order'      =>$order
  23.         ]);
  24.     }
  25. //Error
  26. Array to string conversion [M:\XAMPP\htdocs\__CORE__\lib\Cake\Cache\Engine\FileEngine.php, line 402]
  27. //Code in CORE
  28.  $key = Inflector::underscore(str_replace(array(DS, '/', '.', '<', '>', '?', ':', '|', '*', '"'), '_', strval($key)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement