Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我symfony2用doctrine. 有没有办法在查询中不缓存空结果?
symfony2
doctrine
$query->useResultCache(true, 3600, 'example');
您可以使用自己的类扩展结果缓存驱动程序并包装其“保存”方法。
有多个缓存提供者,它们都扩展了这个抽象类
创建包装器后,您可以直接在 config.yml 中定义缓存提供程序类(或者如果您移动了学说的参数)。这是 Doctrine 的配置参考。在上面链接的页面中,您应该查看下的class参数result_cache_driver。
class
result_cache_driver