diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-24 18:14:08 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-24 18:14:08 +0000 |
commit | ce90f559254686fca490d91d2539956b748406e7 (patch) | |
tree | 77b49663f05da2230167f4138f9a22d352bb2409 /engine/lib | |
parent | c2df2c6af3fb644cbcdd34d2049e905f77cc7b11 (diff) | |
download | elgg-ce90f559254686fca490d91d2539956b748406e7.tar.gz elgg-ce90f559254686fca490d91d2539956b748406e7.tar.bz2 |
Introducing the 'delete relationship' event. Fixes #779
git-svn-id: https://code.elgg.org/elgg/trunk@2933 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/relationships.php | 8 |
1 files changed, 6 insertions, 2 deletions
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;
+ } } /** |