0

私は 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結果が得られます。

スキーマの何が問題になっていますか?

4

1 に答える 1

0

友好関係は対等な入れ子関係です。equal: true例のビットショーが欠落しているようです。さらに、refClass でリレーションを定義する必要はありません。

于 2012-06-17T20:47:37.917 に答える