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
If you are trying to access DBAL from EntityRepository class, you can use $this->getEntityManager()->getConnection() to get it.
Ex:
class CustomRepository extends EntityRepository
{
public function myCustomFunction()
{
$conn = $this->getEntityManager()->getConnection();
$stmt = $conn->query($sql);
if ($stmt)
{
while ($row = $stmt->fetch())
var_dump($row);
}
}
}