From f808dd9d01c2c72779177438a8339af9d2544365 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 27 Dec 2008 03:35:57 +0000 Subject: Add clear_permanent() --- core/helpers/message.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/message.php b/core/helpers/message.php index 4860bea6..25d7c150 100644 --- a/core/helpers/message.php +++ b/core/helpers/message.php @@ -84,6 +84,17 @@ class message_Core { } } + /** + * Remove any permanent message by key. + * @param string $permanent_key + */ + public function clear_permanent($permanent_key) { + $message = ORM::factory("message")->where("key", $permanent_key)->find(); + if ($message->loaded) { + $message->delete(); + } + } + /** * Get any pending messages. There are two types of messages, transient and permanent. * Permanent messages are used to let the admin know that there are pending administrative -- cgit v1.2.3