aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/river2.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-27 16:21:40 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-27 16:21:40 +0000
commit3aeb6fcf7a5fab9050803e49af7cab6ea094ba4e (patch)
tree4cdf4a0a36703d83d43561a106bb3036599d9be3 /engine/lib/river2.php
parenta3fb93cc2fe7461b2aadac4ead9e16c24eeb0aa6 (diff)
downloadelgg-3aeb6fcf7a5fab9050803e49af7cab6ea094ba4e.tar.gz
elgg-3aeb6fcf7a5fab9050803e49af7cab6ea094ba4e.tar.bz2
Fixes #1419: Added remove_from_river_by_annotation(). Deleting annotations now deletes their river entry.
git-svn-id: http://code.elgg.org/elgg/trunk@3850 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/river2.php')
-rw-r--r--engine/lib/river2.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/engine/lib/river2.php b/engine/lib/river2.php
index 09a6b0cc7..02a2a0732 100644
--- a/engine/lib/river2.php
+++ b/engine/lib/river2.php
@@ -96,6 +96,23 @@ function remove_from_river_by_object($object_guid) {
}
/**
+ * Removes all items relating to a particular annotation being acted upon from the river
+ *
+ * @param int annotation_id The ID of the annotation
+ * @return true|false Depending on success
+ */
+function remove_from_river_by_annotation($annotation_id) {
+ // Sanitise
+ $annotation_id = (int) $annotation_id;
+
+ // Load config
+ global $CONFIG;
+
+ // Remove
+ return delete_data("delete from {$CONFIG->dbprefix}river where annotation_id = {$annotation_id}");
+}
+
+/**
* Sets the access ID on river items for a particular object
*
* @param int $object_guid The GUID of the entity
@@ -287,4 +304,4 @@ function elgg_view_river_items($subject_guid = 0, $object_guid = 0, $subject_rel
}
return '';
-} \ No newline at end of file
+}