You are here

API_CHANGES.txt in User Relationships 5.2

ver 1.x -> 2.x
=================
The following functions have been removed and can be replaced with their counterpart.

  old                                               |   new
  --------------------------------------------------|---------------------------------------------------------------
  user_relationships_load_relationships             |   user_relationships_load($criteria)
  user_relationships_relationship_load              |   user_relationships_load($rid)
  user_relationships_load_all_for_user              |   user_relationships_load(array('user' => $uid))
  user_relationships_count_relationships            |   user_relationships_load($criteria, TRUE)
  user_relationships_load_relationships_by_relatee  |   user_relationships_load($criteria, FALSE, 'requestee_id')


The action items (listed below) don't require any changes. 
user_relationships_request_relationship will now accept simple uids and rtids instead of requiring the full object

  user_relationships_request_relationship
  user_relationships_update_relationship
  user_relationships_delete_relationship


The following relationships remain unchanged:

  user_relationships_get_message
  user_relationships_relationship_type_load
  user_relationships_relationship_types_load


The load function (user_relationships_load) gets some fancy features:

user_relationships_load($param = array(), $count = FALSE, $sort = 'rid', $order = NULL, $limit = NULL)

  $param is an array of parameters with the key being the column. There are two special keys now:
    array("between" => array($uid1, $uid2)) will return all relationships between the two user ids.
    array("user" => $uid) will return all relationships for the specified uid

  $count is a boolean stating whether or not the return value should be the number of relationships found

  $sort is a string containing a valid column name which will become the key for the returned array of relationships

  $order is a string containing SQL stating the column and direction of the sort (ex. "requester_id ASC, rtid DESC")

  $limit is a string containing SQL stating the limit (ex "10" or "10, 5")

  return:
    an array of relationships
    if the key is "rid" the array will be a single dimention: array($rid => $relationship, $rid => $relationship)
    otherwise it'll be multidimentional: array($rtid => array($relationship, $relationship))

File

API_CHANGES.txt
View source
  1. ver 1.x -> 2.x
  2. =================
  3. The following functions have been removed and can be replaced with their counterpart.
  4. old | new
  5. --------------------------------------------------|---------------------------------------------------------------
  6. user_relationships_load_relationships | user_relationships_load($criteria)
  7. user_relationships_relationship_load | user_relationships_load($rid)
  8. user_relationships_load_all_for_user | user_relationships_load(array('user' => $uid))
  9. user_relationships_count_relationships | user_relationships_load($criteria, TRUE)
  10. user_relationships_load_relationships_by_relatee | user_relationships_load($criteria, FALSE, 'requestee_id')
  11. The action items (listed below) don't require any changes.
  12. user_relationships_request_relationship will now accept simple uids and rtids instead of requiring the full object
  13. user_relationships_request_relationship
  14. user_relationships_update_relationship
  15. user_relationships_delete_relationship
  16. The following relationships remain unchanged:
  17. user_relationships_get_message
  18. user_relationships_relationship_type_load
  19. user_relationships_relationship_types_load
  20. The load function (user_relationships_load) gets some fancy features:
  21. user_relationships_load($param = array(), $count = FALSE, $sort = 'rid', $order = NULL, $limit = NULL)
  22. $param is an array of parameters with the key being the column. There are two special keys now:
  23. array("between" => array($uid1, $uid2)) will return all relationships between the two user ids.
  24. array("user" => $uid) will return all relationships for the specified uid
  25. $count is a boolean stating whether or not the return value should be the number of relationships found
  26. $sort is a string containing a valid column name which will become the key for the returned array of relationships
  27. $order is a string containing SQL stating the column and direction of the sort (ex. "requester_id ASC, rtid DESC")
  28. $limit is a string containing SQL stating the limit (ex "10" or "10, 5")
  29. return:
  30. an array of relationships
  31. if the key is "rid" the array will be a single dimention: array($rid => $relationship, $rid => $relationship)
  32. otherwise it'll be multidimentional: array($rtid => array($relationship, $relationship))