-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Replacing EntityManagerInterface -> $this->getDoctrine()->getManager(); #8089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We had a conversation that we should use the helpers when they are available
@@ -586,7 +588,7 @@ Take a look at the previous example in more detail: | |||
|
|||
.. _doctrine-entity-manager: | |||
|
|||
* **line 10** The ``EntityManagerInterface`` type-hint tells Symfony to pass you Doctrine's | |||
* **line 13** The ``$this->getDoctrine()->getManager()`` method gets Doctrine's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified all the lines are correct via platform.sh
doctrine/associations.rst
Outdated
{ | ||
$product = $em->getRepository('AppBundle:Product') | ||
$product = $this->getDoctrine() | ||
->getManager() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is useless, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch - removed it :)
doctrine.rst
Outdated
@@ -551,10 +551,11 @@ a controller, this is pretty easy. Add the following method to the | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use Doctrine\Common\Persistence\ManagerRegistry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed
form/form_dependencies.rst
Outdated
{ | ||
// or fetch the em via the container | ||
// $em = $this->get('doctrine')->getManager(); | ||
$em = $this->get('doctrine')->getManager(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using getDoctrine()
here?
When I was updating everything to use type-hints for 3.3, we had discussed that we should probably recommend using the helper method
$this->getDoctrine()
in the controller instead of type-hintingEntityManagerInterface
. This reverts my changes to reflect that.