aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggEntity.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 22:59:36 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-13 22:59:36 +0000
commit4be522d7544b1aca0e08828bee42a9be7345bf9c (patch)
treebb1c2ce1f7f177b2de7bb9615c4e87ea58516945 /engine/classes/ElggEntity.php
parentc1c2563fc1cd451afaf735350eb1c576740be2f4 (diff)
downloadelgg-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/ElggEntity.php')
-rw-r--r--engine/classes/ElggEntity.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php
index ea2a329d9..4e1bc586c 100644
--- a/engine/classes/ElggEntity.php
+++ b/engine/classes/ElggEntity.php
@@ -292,9 +292,9 @@ abstract class ElggEntity extends ElggData implements
public function setMetaData($name, $value, $value_type = "", $multiple = false) {
if (is_array($value)) {
unset($this->temp_metadata[$name]);
- remove_metadata($this->getGUID(), $name);
foreach ($value as $v) {
if ((int) $this->guid > 0) {
+ elgg_delete_metadata(array('guid' => $this->guid, 'metadata_name' => $name));
$multiple = true;
if (!create_metadata($this->getGUID(), $name, $v, $value_type,
$this->getOwnerGUID(), $this->getAccessID(), $multiple)) {
@@ -349,7 +349,7 @@ abstract class ElggEntity extends ElggData implements
*
* @return mixed bool
*/
- public function clearMetaData($name = "") {
+ public function clearMetaData($name = '') {
if (empty($name)) {
return clear_metadata($this->getGUID());
} else {
@@ -357,7 +357,6 @@ abstract class ElggEntity extends ElggData implements
}
}
-
/**
* Get a piece of volatile (non-persisted) data on this entity.
*