I have the following code:
$repo = $this->get('doctrine.orm.default_entity_manager')
->getRepository('Acme:Foo');
For writing, the code works correctly, since I can use $repoits methods and resulting objects without problems.
However, PhpStorm highlights the line 'doctrine.orm.default_entity_manager'and gives me the following error:
Service missing
I get the same error in my service files when accessing this particular service. After that, obviously, autocomplete doesn't work. Of course, I can use the following workaround:
$em = $this->get('doctrine.orm.default_entity_manager');
$em->getRepository('Acme:Foo');
This way I am still getting a warning, but autocomplete is working correctly. However, I prefer my code to be as clean from as many annotations as possible, plus I'm pretty sure there is an easy solution there. Of course, I cleared my cache several times.
?
EDIT: , Symfony2.