我对 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
的结果时。
我的架构有什么问题?