How to determine directionality of a one-way relationship in relationship object

rfay - July 2, 2009 - 17:43
Project:User Relationships
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi -

I note there is not a specific marker to determine the directionality of a one-way relationship in a relationship object. Is it just assumed to be requiester -> requestee? It doesn't seem like this is actually a valid implication. But if that's the magic, I'd appreciate if you'd let me know.

Thanks,
-Randy

#1

alex.k - July 5, 2009 - 20:01
Status:active» fixed

Correct, requester is the user who initiated the relationship. What this means on your site is up to you :)

With two-way relationships it's unfortunately impossible to determine who initiated the relationship, I think.

#2

rfay - July 5, 2009 - 20:06

@alex.k, thanks for the response. It didn't quite answer the question, and that may be because of an ambiguity in user_relationships, or a lack of understanding on my part.

The requester/requestee of a (generic) one-way relationship might not be the same as the direction of the relationship.

In a real-world example, a student might come to a teacher to request a relationship, and the teacher might also come to the student to request the relationship. In either case the requester/requestee relationship is not exactly the same as the named relationship. Is there a way to sort this out in user_relationships? Or am I just confused?

#3

rfay - July 5, 2009 - 20:06
Status:fixed» active

#4

alex.k - July 5, 2009 - 20:12

No problem. To operate on your example, you'd define two types of one-way relationships: one that would be used by the student, the other by the teacher. This assumes you want to model an asymmetric relationship between them. You would name them so that the wording makes sense to the person (i.e. teacher/student, mentor/pupil, parent/child, etc. - not something like fan, follower, buddy which by nature may be used at either end). Then, through roles or another mechanism, make sure that students can only request their allowed kind, and teachers similarly. So in short, directionality depends as much on how you name the relationship as on who is the requester.

#5

rfay - July 20, 2009 - 12:26
Status:active» fixed

#6

System Message - August 3, 2009 - 12:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.