我想删除一个字符串前缀我所有的缓存条目,但我的代码返回:主义缓存的Symfony2 deleteByPrefix
Fatal error: Call to undefined method Doctrine\Common\Cache\FilesystemCache::deleteByPrefix()
和我的代码是
$deleted = $cachemanager->deleteByPrefix('catalog_');
等,其中我查了一下:进入教条http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/caching.html#deleting的文件。
我需要清除缓存,因为控制器,而不是从CLI ...
是否有人来替代这种方法“deleteByPrefix()”?
你的缓存管理器实际上是一个'FilesystemCache'对象具有[无方法(HTTP:// API .nellafw.org/class-Doctrine.Common.Cache.Cache.html)'deleteByPrefix'。使你的'$ cachemanager'成为一个对象的实例,它将* wrap * doctrine的缓存并添加你的自定义方法 – Touki