Snippets tagged "propel cache" Snippets tagged "propel cache"

[Symfony] Cacher un objet Propel sérialisé

Peut être utile pour les gros objets couteux et utilisés souvent.

$key = md5('myPropelObjectKey');
$cache = new sfProcessCache();
if ($cache->has($key)) 
{
  $obj = unserialize($cache->get($key));
}
else
{
  $obj = Table::doSelect();
  $cache->set($key, serialize($obj))
}
by Nicolas Perriault on 2007-01-17, tagged cache  propel  symfony 
(2 comments)