简体   繁体   English

Symfony2 Doctrine2缓存

[英]Symfony2 Doctrine2 Cache

The questions is related to my other ANSWERED question - Symfony2 YAML Entity field not being bound 这些问题与我的其他回答有关-Symfony2 YAML实体字段未绑定

I have problems with my queries. 我的查询有问题。 Once I add VIA CONSOLE new entity fields - they are not being selected automatically. 添加VIA CONSOLE后,新的实体字段-不会自动选择。 I've narrowed down problem to this... 我将问题缩小到这个范围...

I have query like this: 我有这样的查询:

"SELECT o from Infobiz\\CoreBundle\\Entity\\Organization as o LEFT JOIN o.picture as p WHERE o.slug = ?1"; “从Infobiz \\ CoreBundle \\ Entity \\ Organization中选择o为LEFT JOIN o.picture为p WHERE o.slug =?1”;

This query, in the debugger, does not get the select of a new field. 在调试器中,此查询未获得对新字段的选择。 Try again, but: 再试一次,但是:

"SELECT o from Infobiz\\CoreBundle\\Entity\\Organization as o LEFT JOIN o.picture as p WHERE o.slug = ?1 "; “从Infobiz \\ CoreBundle \\ Entity \\ Organization中选择o为LEFT JOIN o.picture为p WHERE o.slug =?1“;

I added space inside of DQL string and THIS query DOES get the select of a new field. 我在DQL字符串中添加了空格,此查询确实选择了一个新字段。 How can I avoid adding spaces to every other query there is??? 如何避免在其中的所有其他查询中添加空格??? I've tried everything here - Symfony2 doctrine clear cache - does not work. 我在这里尝试了所有操作-Symfony2学说清除缓存 -无法正常工作。 Clearly, though, it's a caching problem. 显然,这是一个缓存问题。 Just don't know what it is. 只是不知道那是什么。

I was using memcache and it was caching all DQLS: 我正在使用内存缓存,并且缓存了所有DQLS:

php app/console memcached:clear --clearAll default

default being the "cluster" name in config. 默认为配置中的“群集”名称。 the NAME not id. NAME(不是ID)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM