Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. //MODEL
  3. //normal stuff up here
  4.  
  5. function getSources(){
  6.         if( ($data = Cache::read( 'sources' )) === false ){
  7.             $data = $this->find('list');
  8.             Cache::write('sources', $data);
  9.         }
  10.         return $data;
  11.     }
  12.  
  13.    function afterSave(){
  14.        Cache::clear();
  15.    }
  16.  
  17.    function afterDelete(){
  18.        Cache::clear();
  19.    }