我正在学习如何使用doctrine2和symfony 2使用此link实现Redis缓存,它一切正常,但我最大的问题是我无法控制的查询,这些查询由Symfony中的实体运行,如这个例子:
SELECT s0_.id AS id_0, s0_.name AS name_1, ST_AsText(s0_.wkt) AS
wkt_2, s0_.strategy AS strategy_3, s0_.type AS type_4, s0_.deleted_at
AS deleted_at_5, s0_.beach_id AS beach_id_6, s0_.pmp_id AS pmp_id_7
FROM stretch s0_
WHERE (s0_.pmp_id = ?) AND (s0_.deleted_at IS NULL)
ORDER BY s0_.name ASC
我想这是由来自学说的默认findBy()
调用创建的,但我无法找到如何在此查询中设置$query->useResultCache(true)
。
是否可以将缓存设置为这些特定查询?