From 4be522d7544b1aca0e08828bee42a9be7345bf9c Mon Sep 17 00:00:00 2001 From: brettp Date: Sun, 13 Feb 2011 22:59:36 +0000 Subject: Refs #2907. DRY'd up and abstracted out a lot of metadata / annotation functions so I can implement #1115 with a clean conscious. git-svn-id: http://code.elgg.org/elgg/trunk@8207 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggAnnotation.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'engine/classes/ElggAnnotation.php') diff --git a/engine/classes/ElggAnnotation.php b/engine/classes/ElggAnnotation.php index 10f4269cf..274cbb923 100644 --- a/engine/classes/ElggAnnotation.php +++ b/engine/classes/ElggAnnotation.php @@ -78,7 +78,27 @@ class ElggAnnotation extends ElggExtender { * @return bool */ function delete() { - return delete_annotation($this->id); + return elgg_delete_metastring_based_object_by_id($this->id, 'annotations'); + } + + /** + * Disable the annotation. + * + * @return bool + * @since 1.8 + */ + function disable() { + return elgg_set_metastring_based_object_enabled_by_id($this->id, 'no', 'annotations'); + } + + /** + * Enable the annotation. + * + * @return bool + * @since 1.8 + */ + function enable() { + return elgg_set_metastring_based_object_enabled_by_id($this->id, 'yes', 'annotations'); } /** -- cgit v1.2.3