diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-27 13:18:23 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-27 13:18:23 +0000 |
commit | de1a731825e9d9d2ea13077949d6937d28b31b04 (patch) | |
tree | b2b5ef5aee482e53fca37604b40ac5e3d0f66904 /engine/lib/entities.php | |
parent | 02fd4f532a273b3c950747bb932a34562c2829b3 (diff) | |
download | elgg-de1a731825e9d9d2ea13077949d6937d28b31b04.tar.gz elgg-de1a731825e9d9d2ea13077949d6937d28b31b04.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* Array support added
git-svn-id: https://code.elgg.org/elgg/trunk@274 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index f6ee90092..5dee5a4bb 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -124,13 +124,21 @@ * Set a piece of metadata. * * @param string $name - * @param string $value + * @param mixed $value * @param string $value_type * @return bool */ public function setMetaData($name, $value, $value_type = "") { - return create_metadata($this->getGUID(), $name, $value, $value_type, $this->getOwner()); + if (is_array($value)) + { + foreach ($value as $v) + if (!create_metadata($this->getGUID(), $name, $v, $value_type, $this->getOwner(), true)) return false; + + return true; + } + else + return create_metadata($this->getGUID(), $name, $value, $value_type, $this->getOwner()); } /** |