Foreign key outlet-config.php

19 views
Skip to first unread message

Román Ginés Martínez Ferrández

unread,
Apr 19, 2011, 4:58:48 AM4/19/11
to outle...@googlegroups.com
Hello,

What can I do if I have these two tables?

Projects (id1, id2, name)
id1, id2 --> primary key

Bugs (id, projectID1, projectID2, description)
id --> primary key
projectID1, projectID2 --> foreign key to Projects (id1, id2)



This is valid?

'associations' => array(
               array('one-to-many', 'Bugs', array('key'=>'ProjectID1','key'=>'ProjectID2'))
               )


What I write in the outlet-config.php file in this case?

Thank you.

Aryel Tupinambá

unread,
Apr 19, 2011, 11:18:22 PM4/19/11
to outle...@googlegroups.com
Hello!

No, that is not valid. When you define:

array('key' => 'ProjectID1', 'key' => 'ProjectID2');

You are ultimately defining:

array('key' => 'ProjectID2');

That happens because you're using the same index name. As far as I know, Outlet ORM does not support this sort of association.
You may be able to, however, create a separate named index with both fields. Or you could add this functionality to Outlet yourself.

Hope this clarifies it.
 ARYEL TUPINAMBÁ | DIRETOR DE DESENVOLVIMENTO |   w w w . l i q u i d i . c o m . b r  | + 55 11 2548 1752 | +55 11 7647 6374


--
You received this message because you are subscribed to the Google Groups "Outlet ORM" group.
To post to this group, send email to outle...@googlegroups.com.
To unsubscribe from this group, send email to outlet-orm+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/outlet-orm?hl=en.

Reply all
Reply to author
Forward
0 new messages