Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

SymfonyCasts

Go Pro with Doctrine Queries

via SymfonyCasts

Overview

You already know how to query with SQL, so learning how to do complex queries with Doctrine should not be a pain! In this tutorial, we'll learn about:

  • the language Doctrine speaks (DQL)
  • the QueryBuilder object
  • JOINs! And using them to reduce queries
  • SELECTing specific fields instead of entire objects
  • If all else fails, run raw SQL queries!
  • Using Criteria to efficiently filter relation collections

And more! Let's see what kind of crazy queries we can create!

Syllabus

  • Doctrine DQL
  • The QueryBuilder
  • andWhere() and orWhere()
  • JOINs
  • JOINs and addSelect Reduce Queries
  • EXTRA_LAZY Relationships
  • SELECT the SUM (or COUNT)
  • Selecting Specific Fields
  • SELECTing into a New DTO Object
  • Raw SQL Queries
  • Reusing Queries in the Query Builder
  • Criteria: Filter Relation Collections
  • Filters: Automatically Modify Queries
  • WHERE IN()
  • Using RAND() or Other Non-Supported Functions
  • Using GROUP BY to Fetch & Count in 1 Query

Taught by

Victor Bocharsky and Ryan Weaver

Reviews

Start your review of Go Pro with Doctrine Queries

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.