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ます。クエリで null の結果をキャッシュしない方法はありますか?
symfony2
doctrine
$query->useResultCache(true, 3600, 'example');
結果キャッシュ ドライバを独自のクラスで拡張し、その「保存」メソッドをラップすることができます。
複数のキャッシュプロバイダーがあり、それらはすべてこの抽象クラスを拡張します
ラッパーを作成したら、キャッシュ プロバイダー クラスを config.yml で直接定義できます (または、doctrine のパラメーターを移動した場合)。Doctrine の構成リファレンスは次のとおりです。class上記のリンク先のページで、 の下のパラメータを確認してくださいresult_cache_driver。
class
result_cache_driver