You are here

function _user_relationships_current_relationships in User Relationships 5

2 calls to _user_relationships_current_relationships()
user_relationships_request_form in ./user_relationships_forms.inc
Request new user to user relationship
user_relationships_request_validate in ./user_relationships_actions.inc
Validate relationship request.

File

./user_relationships.module, line 141

Code

function _user_relationships_current_relationships(&$requester, &$requestee) {
  $current_relationships = array();
  $requester_relationships = user_relationships_load_all_for_user($requester->uid);
  foreach ($requester_relationships as $relationship) {
    if ($relationship->requestee_id == $requestee->uid || ($relationship->is_oneway ? FALSE : $relationship->requester_id == $requestee->uid)) {
      $current_relationships[$relationship->rtid] = $relationship;
    }
  }
  return $current_relationships;
}