From ce90f559254686fca490d91d2539956b748406e7 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 24 Feb 2009 18:14:08 +0000 Subject: Introducing the 'delete relationship' event. Fixes #779 git-svn-id: https://code.elgg.org/elgg/trunk@2933 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/relationships.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engine/lib/relationships.php') diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php index 4316fc695..d8e7d7abe 100644 --- a/engine/lib/relationships.php +++ b/engine/lib/relationships.php @@ -417,8 +417,12 @@ $guid_one = (int)$guid_one; $relationship = sanitise_string($relationship); $guid_two = (int)$guid_two; - - return delete_data("DELETE from {$CONFIG->dbprefix}entity_relationships where guid_one=$guid_one and relationship='$relationship' and guid_two=$guid_two"); + + if (trigger_elgg_event('delete', $relationship, $obj)) { + return delete_data("DELETE from {$CONFIG->dbprefix}entity_relationships where guid_one=$guid_one and relationship='$relationship' and guid_two=$guid_two"); + } else { + return false; + } } /** -- cgit v1.2.3