Featured Post

Dodatkowy odstęp od górnej krawędzi w HTML5

Tym razem po polsku… bo nie tylko po angielsku będę tu pisał Swoje pierwsze kroki z HTML5 mam już za sobą i chciałbym podzielić się pewnym zaskakującym działaniem nowych tagów. Otóż mój przykładowy dokument HTML wyglądał tak: Przykład użycia SubForm z ZF1 w HTML5 Kod źródłowy...

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…