Domanda

I just finished the Symblog tutorial for symfony. Everything works just fine except when I try running the project on the production environment. On the blog page the following error message appears on the top of the page and on top of the comment section: Deprecated: getEntityManager is deprecated since Symfony 2.1. Use getManager instead in F:\xampp\htdocs\php\symblog\vendor\doctrine\doctrine-bundle\Doctrine\Bundle\DoctrineBundle\Registry.php on line 71 I am wondering why because I used the same version (symfony 2.3.10) for other projects and in these I have never seen this message. So what should I do? Thanks in advance!

È stato utile?

Soluzione

You should replace your code to use getManager() method instead of getEntityManager() or just change your error_reporting PHP setting (take a look at the below snippet).

The reason of not showing other depreciation messages in other project is different error reporting configuration (probably somwthing similar to the following - deprecated warnings will not be reported):

error_reporting(E_ALL ^ E_DEPRECATED);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top