Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Place DQL in front of QueryBuilder #5302

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update doctrine.rst
  • Loading branch information
herewegoo committed May 23, 2015
commit 027a835c52853005effb545f89184bcc3d10bea5
10 changes: 5 additions & 5 deletions 10 book/doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,9 @@ or using Doctrine's Query Builder.
Querying for Objects with DQL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Instead of using the ``QueryBuilder``, you can alternatively write the queries
directly using DQL::
Imagine that you want to query for products, but only return products that
cost more than ``19.99``, ordered from cheapest to most expensive. You can use
Doctrine's native SQL-like language called DQL to do query for this::

$em = $this->getDoctrine()->getManager();
$query = $em->createQuery(
Expand All @@ -752,9 +753,8 @@ covered later), group, etc. For more information, see the official
Querying for Objects Using Doctrine's Query Builder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Imagine that you want to query for products, but only return products that
cost more than ``19.99``, ordered from cheapest to most expensive. You can use
Doctrine's ``QueryBuilder`` for this::
Instead of writing a DQL string, you can alternatively use a helpful object called
the ``QueryBuilder`` to build that string for you::

$repository = $this->getDoctrine()
->getRepository('AppBundle:Product');
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.