Mr. Carl Sun Apr 15 13:48:51 -0400 2012
1 class User extends ActiveRecordModel
2 {
3 static $has_many = array
4 (
5 array('login_tokens','class_name' => 'UserLoginToken', 'foreign_key' => 'user_id' )
6 );
7 }
The the foreign_key is the field name in the current class (User) that links to UserLoginToken class primary key.
If you still have issues may need to set the primary key (see the code below).
1 array('login_tokens','class_name' => 'UserLoginToken', 'foreign_key' => 'user_id', 'primary_key' => 'feildLink' )
Field link is the field name in UserLoginToken that link to User. See Associations for more information.
dado campo Tue Apr 24 22:10:23 -0400 2012
The second one works. Thanks! Beer to you bud!
(1-2/2)
Subject: Can you spot what I've done wrong?
When I access $user->login_tokens it's an empty array, anybody?