You are here

function user_relationship_defaults_load in User Relationships 6

Same name and namespace in other branches
  1. 5 plugins/user_relationship_defaults/user_relationship_defaults.module \user_relationship_defaults_load()
  2. 5.2 plugins/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 to retrieve the full list of default relationships

Return value

array of default relationship objects

4 calls to user_relationship_defaults_load()
user_relationship_defaults_delete_form_submit in user_relationship_defaults/user_relationship_defaults.module
Process default relationship delete form submission.
user_relationship_defaults_user in user_relationship_defaults/user_relationship_defaults.module
hook_user()
user_relationship_defaults_user_relationships_page_alter in user_relationship_defaults/user_relationship_defaults.module
hook_user_relationships_admin_page_alter()
user_relationship_default_load in user_relationship_defaults/user_relationship_defaults.module
Public API for retrieving a default relationship.

File

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

Code

function user_relationship_defaults_load($reset = FALSE) {
  static $defaults = array();
  if ($reset || !$defaults) {
    $results = db_query("SELECT * FROM {user_relationship_defaults}");
    while ($default = db_fetch_object($results)) {
      $default->user = user_load($default->uid);
      $default->user_name = $default->user->name;
      $default->relationship_type = user_relationships_type_load($default->rtid);
      foreach ((array) $default->relationship_type as $column => $value) {
        $default->{$column} = $value;
      }
      $defaults[$default->rdid] = $default;
    }
  }
  return $defaults;
}