我对refClass关系有一个奇怪的行为:
User:
[.....]
MyFriends: {class: User, refClass: UserFriend, local: id_owner, foreign: id_friend, type: many}
UserFriend:
columns:
id_owner: {type: integer(8)}
id_friend: {type: integer(8)}
relations:
Owner: {class: User, local: id_owner, foreign: id, type: one}
Friend: {class: User, local: id_friend, foreign: id, type: one}
其中id_owner
是朋友关系的“所有者”,id_friend
是朋友。
但是,当我尝试获取$user->getMyFriends()
时,我会得到与$user
相同的结果。
我的架构有什么问题?