diff options
Diffstat (limited to 'engine/lib/annotations.php')
-rw-r--r-- | engine/lib/annotations.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index 8ad918180..dd647444a 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -820,6 +820,27 @@ }
}
+ } + + /** + * Clear all annotations belonging to a given owner_guid + * + * @param int $owner_guid The owner + */ + function clear_annotations_by_owner($owner_guid) + { + $owner_guid = (int)$owner_guid; + + $annotations = get_data("SELECT id from {$CONFIG->dbprefix}annotations WHERE owner_guid=$owner_guid"); + $deleted = 0; + + foreach ($annotations as $id) + { + if (delete_annotation($id)) // Is this the best way? + $deleted++; + } + + return $deleted; }
/**
|