Welcome Guest, Not a member yet? Register   Sign In
DataMapper: In-table Foreign Key with non-standard name
#4

[eluser]Genki1[/eluser]
Follow-up question:

Now that my $has_one array includes customized attributes for a relationship, how do I specify other relationships that are to be used with DataMapper's default settings?

In other words, would I specify the 'user' relationship like this...

Code:
// related models that each record in this table can have just one of.
var $has_one = array(
  'user',  
  'lookup' => array(
   'join_other_as' => 'account_type') //ITFK is account_type_id, not lookup_id
);

...or like this?
Code:
// related models that each record in this table can have just one of.
var $has_one = array(
  'user' => array(),  
  'lookup' => array(
   'join_other_as' => 'account_type') //ITFK is account_type_id, not lookup_id
);


Messages In This Thread
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 04-30-2012, 12:26 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 04-30-2012, 02:41 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 04-30-2012, 03:07 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 05-01-2012, 01:02 AM
DataMapper: In-table Foreign Key with non-standard name - by El Forum - 05-01-2012, 04:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB