You are here

function user_relationship_defaults_load in User Relationships 5

Same name and namespace in other branches
  1. 5.2 plugins/user_relationship_defaults/user_relationship_defaults.module \user_relationship_defaults_load()
  2. 6 user_relationship_defaults/user_relationship_defaults.module \user_relationship_defaults_load()
  3. 7 user_relationship_defaults/user_relationship_defaults.module \user_relationship_defaults_load()

Public API for retrieving a default relationship.

Parameters

$rdid: integer of the default relationship id

Return value

object of the default relationship with the user object and relationship_type object

1 call to user_relationship_defaults_load()
user_relationship_defaults_delete_form in plugins/user_relationship_defaults/user_relationship_defaults.module
Default Relationship delete confirmation.

File

plugins/user_relationship_defaults/user_relationship_defaults.module, line 22
Drupal Module: User Relationship Defaults

Code

function user_relationship_defaults_load($rdid) {
  $default = db_fetch_object(db_query("SELECT * FROM {user_relationship_defaults} WHERE rdid = %d", $rdid));
  $default->user = user_load(array(
    'uid' => $default->uid,
  ));
  $default->relationship_type = user_relationships_relationship_type_load(array(
    'rtid' => $default->rtid,
  ));
  return $default;
}