PHP Doctrine: generation problem?

Posted by ropstah on Stack Overflow See other posts from Stack Overflow or by ropstah
Published on 2010-04-05T23:24:29Z Indexed on 2010/04/05 23:33 UTC
Read the original article Hit count: 300

Filed under:
|

I'm generating models from my Mysql db. It generates a foreign key collection properly, but not the other way around... Is this supposed to be 'by-design', or am i doing something wrong?

pseudo code alert

User:
  UserId pk
  LocationId fk     //User location

Location
  LocationId pk
  UserId fk         //Location owner

Generated code:

class User() {
    hasMany('Location') //for locations owned by the user

    //BUT NOT THIS ONE:
    //hasOne('Location_1') //for current location of user
}

class Location() {
    hasMany('User') //for users which are on that location

    //AND NOT THIS ONE
    //hasOne('User_1') //for location owner
}

© Stack Overflow or respective owner

Related posts about php

Related posts about doctrine