diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-23 08:29:45 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-05-23 08:29:45 +0000 |
commit | dcbc30908a7d2f49e581f7bc772f3d848708844f (patch) | |
tree | ae2279b6299eb8f5f819c28ca56503a9fc10d335 /engine | |
parent | d1e63f8b0e12482df558f8f7b90c943316601ebb (diff) | |
download | elgg-dcbc30908a7d2f49e581f7bc772f3d848708844f.tar.gz elgg-dcbc30908a7d2f49e581f7bc772f3d848708844f.tar.bz2 |
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
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/entities.php | 10 |
1 files changed, 7 insertions, 3 deletions
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);
+ } } /**
|