I'm learning Doctrine 2, and noticed that the name of a generated proxy class is the original class' full name, without the 开发者_开发技巧namespace separator, with Proxy
appended to it.
What if you use a namespaced domain model, and there is a collision?
Order => OrderProxy
OrderProduct => OrderProductProxy
Order\Product => OrderProductProxy (!)
Is it possible to change the naming convention for such proxies?
Looks like it's not possible at the moment.
The source code shows that this naming convention is hardcoded:
$proxyClassName = str_replace('\\', '', $className) . 'Proxy';
Anyway, I now tend to think that's it's not such a bad thing: by trying to avoid such collisions, we remove confusion in the naming of our domain classes.
精彩评论