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

Doctrine in 90 minutes

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

8f2089782f2711659072020ad7227aff?s=128

Albert Casademont

July 15, 2014
Tweet

Transcript

  1. Doctrine in 90 minutes

  2. About Albert Casademont ulabox.com @acasademont (I have no Linkedin, sorry!)

  3. None
  4. None
  5. None
  6. None
  7. Doctrine is an ORM Object Relational Mapper

  8. None
  9. None
  10. None
  11. None
  12. None
  13. Complex fetching? DQL to the rescue!

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

    SQL SELECT u.* FROM users u WHERE username = 'albert'
  15. 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'
  16. Tons of nice features custom repositories schema migrations entity listeners

    caching hydrators composite keys
  17. None
  18. None
  19. The entity lifecycle persist/find detach/merge/remove refresh flush

  20. Entity traversal let's be LAZY proxies entities collections

  21. None
  22. Tips use the constructor! update the owning side! generate your

    own id's! be extra lazy! do not var_dump!
  23. Some advanced features entity listeners custom walkers/filters ... and many

    more!
  24. None
  25. http://docs.doctrine-project.org/projects/doctrine-orm/en/latest

  26. None
  27. Performance check-list Metadata & Query cache Profile your DB queries

    DQL join Indexes Hydrators Eager/Lazy load Batch/Detach BONUS: your own change tracker!
  28. finally in Doctrine 2.5...

  29. EMBEDABBLES a.k.a Value Objects

  30. gràcies ;)