Accessing Symfony2 global parameter in entity class

Viewed 13918

I have a value stored in my parameters.ini file, and I need to access it during the prepersist method of my model.

Normally I use $this->container->getParameter('value');, but the container is not available in the entity.

Is there a way to get parameters within an entity class?

P.S. The value is an API key for a service I am pulling info from during prepersist. Best practice is to keep keys/passwords in parameters.ini

2 Answers
Related