Get Symfony Container in an EntityRepository

后端 未结 5 1217
无人共我
无人共我 2020-12-15 11:56

I\'ve set a variable in parameters.ini, but now I want to retrieve that variable from an EntityRepository and $this->container is unset so I can\'t do it

5条回答
  •  旧巷少年郎
    2020-12-15 12:43

    You should not use $container in the EntityRepository. Instead, create a Model Manager service and inject the container through DI.

提交回复
热议问题