symfonydoctrine-ormdoctrine

How to set auto_generate_proxy_classes to AUTOGENERATE_EVAL when using Doctrine with Symfony?


I am getting the constant rename() errors with proxy files (this issue) and I found out that you can call setAutoGenerateProxyClasses(Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_EVAL) to prevent them. This functionality was implemented here and is documented here.

How would I do that in a Symfony application? There is doctrine: orm: auto_generate_proxy_classes but what would I use as the value? 3? (Because that's the value of Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_EVAL.)


Solution

  • You can use Symfony YAML's syntax for consts:

    orm:
        auto_generate_proxy_classes: !php/const Doctrine\ORM\Proxy\ProxyFactory::AUTOGENERATE_EVAL