Symfony 1.4: use relations in fixtures with propel

Posted by iggnition on Stack Overflow See other posts from Stack Overflow or by iggnition
Published on 2010-04-26T08:32:29Z Indexed on 2010/04/26 8:33 UTC
Read the original article Hit count: 296

Hello,

I just started to use the PHP symfony framework. Currently I'm trying to create fixture files in YAML to easily insert data into my MySQL database.

Now my database has a couple of relations, I have the tables Organisation and Location.

Organisation
 org_id (PK)
 org_name

Location
 loc_id (PK)
 org_id (FK)
 loc_name

Now I'm trying too link these tables in my fixture file, but for the life of me I cannot figure out how. Since the org_id is auto-incremented I can't simply use

org_id: 1

In the location fixture.

How can I fix this?

© Stack Overflow or respective owner

Related posts about symfony-1.4

Related posts about yaml