Welcome Guest, Not a member yet? Register   Sign In
How do you setup relationships with DMZ using 3 data tables and a single join table?
#4

[eluser]WanWizard[/eluser]
As of now, it is.

Code:
class Many_a extends DataMapper {

    var $table = 'many_a';
    var $has_one = array();
    var $has_many = array(
              'many_b' => array(
                      'class' => 'many_b',
                      'join_table' => 'many_links'
              ),
              'many_c' => array(
                      'class' => 'many_c',
                      'join_table' => 'many_links'
              )
        );
Which defines
Code:
many_a => many_links => many_b
many_a => many_links => many_c
where the "many_links" table has the foreign keys "many_a_id", "many_b_id" and "many_c_id".

You can download the latest version from http://bitbucket.org/wanwizard/datamapper/downloads, select 'tip'.

I'll update the website in a minute with the updated docs.


Messages In This Thread
How do you setup relationships with DMZ using 3 data tables and a single join table? - by El Forum - 12-08-2010, 02:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB