From dcbc30908a7d2f49e581f7bc772f3d848708844f Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 23 May 2008 08:29:45 +0000 Subject: An improvement to the clearMetadata method on ElggEntities - specify a name and it only clears metadata of that type. git-svn-id: https://code.elgg.org/elgg/trunk@688 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engine') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index 17b6ff7f3..7ce4047bb 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -170,9 +170,13 @@ /** * Clear metadata. */ - public function clearMetaData() - { - return clear_metadata($this->getGUID()); + public function clearMetaData($name = "") + { + if (empty($name)) { + return clear_metadata($this->getGUID()); + } else { + return remove_metadata($this->getGUID(),$name); + } } /** -- cgit v1.2.3