Bug in generating ONE_TO_ONE #344

Open
kigeia opened this Issue Apr 25, 2012 · 0 comments

Projects

None yet

1 participant

@kigeia
Contributor
kigeia commented Apr 25, 2012

Hi,
When declaring a relationship interpreted as one_to_one, for example the bookstore_employee_account, the generation does only reference the primary key of the foreign table, even if specified differently.

For exemple the fixture of bookstore_employee_account contains :

    foreign-key foreignTable="bookstore_employee" onDelete="cascade"
        reference local="employee_id" foreign="id" 
    foreign-key

If you change it to

    foreign-key foreignTable="bookstore_employee" onDelete="cascade"
        reference local="employee_id" foreign="some_foreign_unique_column" 
    foreign-key

The some_foreign_unique_column is ignored and create()->findPk($this->getPrimaryKey(), $con); is used instead in generated class.

You see what I mean ?

Bye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment