diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-14 03:13:31 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-14 03:13:31 +0000 |
commit | 8e065905e4172d0ccd01266c6f8e58a65803d011 (patch) | |
tree | adb6f8d3e3b76f1e6339d46a18945b3b29c80dbc /engine/lib | |
parent | 422434216351c84e868b2c91e8bf0059446b89ed (diff) | |
download | elgg-8e065905e4172d0ccd01266c6f8e58a65803d011.tar.gz elgg-8e065905e4172d0ccd01266c6f8e58a65803d011.tar.bz2 |
Fixes #2918. Moved annotation/metadata delete functions from ElggUser to ElggEntity. When deleted, entities now correctly delete metadata they own as well as metadata on them. Removed uses of deprecated functions.
git-svn-id: http://code.elgg.org/elgg/trunk@8222 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/entities.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index af0092ca1..db0e0fddd 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1462,12 +1462,16 @@ function delete_entity($guid, $recursive = true) { } // Now delete the entity itself - $entity->clearMetadata(); - $entity->clearAnnotations(); - $entity->clearRelationships(); + $entity->deleteMetadata(); + $entity->deleteOwnedMetadata(); + $entity->deleteAnnotations(); + $entity->deleteOwnedAnnotations(); + $entity->deleteRelationships(); + remove_from_river_by_subject($guid); remove_from_river_by_object($guid); remove_all_private_settings($guid); + $res = delete_data("DELETE from {$CONFIG->dbprefix}entities where guid={$guid}"); if ($res) { $sub_table = ""; |