2013-06-03 78 views
0

您是否有人知道如何在zf2項目中爲doctrine 2定義默認結果緩存選項?Doctrine2默認結果緩存

我實際上使用這段代碼。但有沒有一種方法可以爲所有存儲庫定義它,而不是每個存儲庫都爲它們自定義。

$em = $this->get('doctrine.orm.entity_manager'); 
$q = $em->('SELECT i FROM Surgeworks\CoreBundle\Entity\ItemsToCollections i); 
$q->useResultCache(true, 3600, 'somecache_id'); 
$result = $q->getResult(); 

回答