You are here

function user_relationships_delete_relationship in User Relationships 6

Same name and namespace in other branches
  1. 5.3 user_relationships_api/user_relationships_api.api.inc \user_relationships_delete_relationship()
  2. 5 user_relationships_api.inc \user_relationships_delete_relationship()
  3. 5.2 user_relationships_api.inc \user_relationships_delete_relationship()
  4. 7 user_relationships.module \user_relationships_delete_relationship()

Public API for deleting a relationship.

Parameters

$relationship: object of the relationship

$deleted_by: object of the user that initiated the delete command

$op: string reason for removal ('cancel','disapprove','remove')

5 calls to user_relationships_delete_relationship()
user_relationships_rules_action_delete_relationship in user_relationships_rules/user_relationships_rules.rules.inc
Action Implementation: Delete relationship.
user_relationships_ui_pending_requested_submit in user_relationships_ui/user_relationships_ui.actions.inc
Approve, Disapprove, or Cancel a relationship request
user_relationships_ui_remove_submit in user_relationships_ui/user_relationships_ui.actions.inc
Remove a relationship
user_relationship_implications_user_relationships in user_relationship_implications/user_relationship_implications.module
hook_user_relationships() Add or remove implied relationships as directed by configuration
user_relationship_service_delete in user_relationship_service/user_relationship_service.inc

File

user_relationships_api/user_relationships_api.api.inc, line 289
User Relationships API. Data abstraction layer @author Jeff Smick (creator) @author Alex Karshakevich (maintainer) http://drupal.org/user/183217

Code

function user_relationships_delete_relationship(&$relationship, &$deleted_by, $op = 'remove') {
  $relationship->deleted_by = $deleted_by;
  db_query("DELETE FROM {user_relationships} WHERE rid = %d", $relationship->rid);
  _user_relationships_invoke($op, $relationship);
}