diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-13 22:59:36 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-13 22:59:36 +0000 |
commit | 4be522d7544b1aca0e08828bee42a9be7345bf9c (patch) | |
tree | bb1c2ce1f7f177b2de7bb9615c4e87ea58516945 /engine/classes/ElggAnnotation.php | |
parent | c1c2563fc1cd451afaf735350eb1c576740be2f4 (diff) | |
download | elgg-4be522d7544b1aca0e08828bee42a9be7345bf9c.tar.gz elgg-4be522d7544b1aca0e08828bee42a9be7345bf9c.tar.bz2 |
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
Diffstat (limited to 'engine/classes/ElggAnnotation.php')
-rw-r--r-- | engine/classes/ElggAnnotation.php | 22 |
1 files changed, 21 insertions, 1 deletions
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'); } /** |