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
$this->container
You should not use $container in the EntityRepository. Instead, create a Model Manager service and inject the container through DI.