Re: break BC if your object model uses one-to-one relationships
Stefan Leenen <leentje <at> leentje.org>
2007-01-03 14:03:44 GMT
That would most likely be enough yes.
I'll watch the svn commits :)
gr,
Stefan
Hans Lellelid wrote:
> Hi Stefan,
>
> Thanks for the heads-up! I'll try to look into this (& hopefully fix
> it) later today. It may be as simple as just declaring a new var name
> for the special-case one-to-one relationship.
>
> Hans
>
> Stefan Leenen wrote:
>> Hi people,
>>
>> first of all, HAPPY NEW YEAR!
>>
>> I'm just trying out 1.3 trunk and I get some problems with the
>> one-on-one relations. I have the following two tables (see below).
>>
>> This will now give me an error '*Fatal error*: Cannot redeclare
>> BasePerson::$aUser in *propel/classes/om/BasePerson.php* on line *209'
>>
>> *This has to do with the fact that owner_user_id also points to the User
>> table I guess... How would I fix this problem?
>>
>> greets,
>>
>> Stefan
>>
>> <table name="persons" phpName="Person" description="Person module data">
>> <column name="id"
>> type="INTEGER"
>> primaryKey="true"
>> autoIncrement="true"
>> description="" />
>>
>> <column name="firstname"
>> type="VARCHAR"
>> size="255"
>> required="true"
>> description="" />
>>
>> <column name="lastname"
>> type="VARCHAR"
>> size="255"
>> required="true"
>> description="" />
>>
>> <column name="owner_user_id"
>> type="INTEGER"
>> description="" />
>>
>> <foreign-key foreignTable="users" onDelete="setnull"
>> onUpdate="cascade">
>> <reference local="owner_user_id" foreign="person_id" />
>> </foreign-key>
>> </table>
>>
>> <table name="users" phpName="User" description="User accounts">
>> <column name="person_id"
>> type="INTEGER"
>> primaryKey="true" description="" />
>>
>> <column name="username"
>> type="VARCHAR"
>> size="255"
>> required="true"
>> description="" />
>>
>> <foreign-key foreignTable="persons" onDelete="cascade"
>> onUpdate="cascade">
>> <reference local="person_id" foreign="id"/>
>> </foreign-key>
>> </table>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
>> For additional commands, e-mail: users-help <at> propel.tigris.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> propel.tigris.org
> For additional commands, e-mail: users-help <at> propel.tigris.org
>
>