Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Doctrine in 90 minutes

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Doctrine in 90 minutes

Doctrine from the basics to the more advanced topics. Bear in mind that the slides on their own are not very useful without the video!
https://www.youtube.com/watch?v=DYvK9j-jEcU

Avatar for Albert Casademont

Albert Casademont

July 15, 2014

More Decks by Albert Casademont

Other Decks in Programming

Transcript

  1. DQL SELECT u FROM User u WHERE username = 'albert'

    SQL SELECT u.* FROM users u WHERE username = 'albert'
  2. DQL SELECT u,g FROM User u JOIN u.groups g WHERE

    username = 'albert' SQL SELECT u.*,g.* FROM users JOIN users_groups ug ON ug.username = u.user_id JOIN groups g ON g.name = ug.group_id WHERE username = 'albert'
  3. Tips use the constructor! update the owning side! generate your

    own id's! be extra lazy! do not var_dump!
  4. Performance check-list Metadata & Query cache Profile your DB queries

    DQL join Indexes Hydrators Eager/Lazy load Batch/Detach BONUS: your own change tracker!