Archived video

This video is archived and won't be updated. We're keeping it online for now as a courtesy.

Alternate resources: 

Databases and Doctrine

Video loading...

Transcripts: 
Transcript language code: 
eng

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    with Leanna Pelham
  • 0:09
    Symfony doesn't care about your database
  • 0:11
    or the code you use to talk to it.
  • 0:14
    Seriously.
  • 0:15
    It's not trying to be rude, but other libraries
  • 0:17
    already solved this problem.
  • 0:19
    So if you want to make a PDO connection and run raw SQL queries,
  • 0:23
    that's great.
  • 0:25
    When we create services in episode three
  • 0:27
    you'll learn some lifesaving strategies
Loading ...

Databases and Doctrine

Loading...

Symfony doesn’t care about your database or the code you use to talk to it. Most people that use Symfony use a third-party database library called Doctrine. Doctrine maps rows and columns in your database to objects and properties in PHP. Imagine we have an Event object with name and location properties. If we tell Doctrine to save this object, it inserts a row into a table and puts the data on name and location columns. And when we query for the event, it puts the column data back onto the properties of an Event object. When using Doctrine you need to stop thinking about tables, and start thinking about PHP classes. In this lesson, you will create the Event Entity Class, and learn a little debugging trick.

Downloads: 
Log in or sign up to download companion files.
Additional resources: