-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update doctrine.rst #8949
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
Update doctrine.rst #8949
Conversation
Fixes two minor issues in code examples
@@ -654,6 +654,8 @@ In addition to the query builder, you can also query with `Doctrine Query Langua | |||
|
|||
public function findAllGreaterThanPrice($price): array | |||
{ | |||
$em = $this->getEntityManager(); | |||
|
|||
$query = $em->createQuery( |
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 think we could just use $this->_em
here instead.
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'm not sure if this is a good idea, since $this->_em has never been introduced before. Without you mentioning it I wouldn't know it existed. The other code example in the same section doesn't use it as well.
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.
That's true! And in the example below, we use $conn = $this->getEntityManager()->getConnection();
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.
Let's merge this "as is" ... and later we can think of explaining $this->_em
somewhere and using it in all examples.
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.
@MarcusSchwarz well spotted! Thanks.
Thanks Marcus. |
This PR was merged into the 4.0 branch. Discussion ---------- Update doctrine.rst Fixes two minor issues in code examples Commits ------- 4e10bdd Update doctrine.rst
Fixes two minor issues in code examples