I want to add this in my User model for registrations checking for banned
words type thing.
 
  $params = array(
   'contain' => false,
   'fields' => array(
    'Restriction.id',
    'Restriction.name'));
  
  $restrictions = Cache::read('restrictions_cache', 'long');
  
  if (empty($restrictions)) 
  {
   Controller::loadModel('Restriction');
   $restrictions = $this->Restriction->find('list' , $params);
   Cache::write('restrictions_cache', $restrictions,'long');
  }

But how do I search the cache for data?

Right now I  have this to check the table but since the data in Restrictions
never changes I just want to cache the data and do my find with the cached
data.

$q = $this->Restriction->find('first' , array('conditions' => array(
'Restriction.name LIKE' => $value)));

Thanks
 
Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to