function user_relationships_delete_relationship in User Relationships 7
Same name and namespace in other branches
- 5.3 user_relationships_api/user_relationships_api.api.inc \user_relationships_delete_relationship()
- 5 user_relationships_api.inc \user_relationships_delete_relationship()
- 5.2 user_relationships_api.inc \user_relationships_delete_relationship()
- 6 user_relationships_api/user_relationships_api.api.inc \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
$action: 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, Decline, 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_delete in user_relationship_implications/
user_relationship_implications.module - Implements hook_user_relationships_delete().
- user_relationship_service_delete in user_relationship_service/
user_relationship_service.inc - Delete or cancel an relationship.
File
- ./
user_relationships.module, line 714 - User Relationships API. Module shell.
Code
function user_relationships_delete_relationship($relationship, $deleted_by, $action = 'remove') {
$relationship->deleted_by = $deleted_by;
db_delete('user_relationships')
->condition('rid', $relationship->rid)
->execute();
module_invoke_all('user_relationships_delete', $relationship, $action);
}