Featured Post

[pl] 114 rocznica urodzin Antoine de Saint-Exupéry

Dziś obchodzimy niezwykłą rocznicę, bo 114 rocznicę urodzin (29 czerwca 1900) niezwykłego człowieka: Antoine de Saint-Exupéry, świetnego pilota i autora książki “Mały Książę” oraz opowiadań “Nocny lot”, “Ziemia, planeta ludzi”, “Pilot wojenny”...

Read More

Creating one to many relation in Doctrine 2 ORM

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 23-03-2013

Tags: , , , , , , ,

0

Introduction

In this tutorial I will present relational mapping between albums and songs.
In Zend Framework 2 Tutorial we had only one table – it was called albums, and stored albums data.

Today we will extend our sample application with new table – songs.
Each album can has many songs, but single song can be connected to only one album.
It is called relation OneToMany in Doctrine ORM.

Update your database with following:

Writing DQL statements

Posted by Tomasz Kuter | Posted in Programming, Web development | Posted on 21-03-2013

Tags: , , , , , , , , , ,

0

Today I would like to focus on something, what Doctrine 1.x users know, but it looks a little bit different – Doctrine Query Language (DQL) statements.

In the last tutorial we had had working Album Controller, which was using Doctrine Entity Manager, to get the Album data. Now we will focus on something more advanced – writing SQL alike statements to get some data from the album’s table.

So lets begin…