aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-21 20:51:26 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-21 20:51:26 +0000
commit64aafb5ca73d329663a93f80ac9cf3e68a082866 (patch)
treef6462c3112d26aea2ad09cdb76b38abb74183757 /engine/lib/metadata.php
parentc3cbea030adb2201e29897915bfae19f1628c967 (diff)
downloadelgg-64aafb5ca73d329663a93f80ac9cf3e68a082866.tar.gz
elgg-64aafb5ca73d329663a93f80ac9cf3e68a082866.tar.bz2
Merged r6534-6559 from 1.7 branch to trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6840 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 74ea6858a..6e849cdd9 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -186,10 +186,11 @@ function remove_metadata($entity_guid, $name, $value = "") {
* @param int $entity_guid The entity to attach the metadata to
* @param string $name Name of the metadata
* @param string $value Value of the metadata (cannot be associative array)
- * @param string $value_type
- * @param int $owner_guid
- * @param int $access_id
- * @param bool $allow_multiple
+ * @param string $value_type 'text', 'integer', or '' for automatic detection
+ * @param int $owner_guid GUID of entity that owns the metadata
+ * @param int $access_id Default is ACCESS_PRIVATE
+ * @param bool $allow_multiple Allow multiple values for one key. Default is FALSE
+ * @return bool
*/
function create_metadata($entity_guid, $name, $value, $value_type, $owner_guid, $access_id = ACCESS_PRIVATE, $allow_multiple = false) {
global $CONFIG;
@@ -218,8 +219,7 @@ function create_metadata($entity_guid, $name, $value, $value_type, $owner_guid,
if (!$result) {
return false;
}
- }
- else if (isset($value)) {
+ } else if (isset($value)) {
// Support boolean types
if (is_bool($value)) {
if ($value) {
@@ -343,12 +343,12 @@ function update_metadata($id, $name, $value, $value_type, $owner_guid, $access_i
/**
* This function creates metadata from an associative array of "key => value" pairs.
*
- * @param int $entity_guid
- * @param string $name_and_values
- * @param string $value_type
- * @param int $owner_guid
- * @param int $access_id
- * @param bool $allow_multiple
+ * @param int $entity_guid The entity to attach the metadata to
+ * @param string $name_and_values Associative array
+ * @param string $value_type 'text', 'integer', or '' for automatic detection
+ * @param int $owner_guid GUID of entity that owns the metadata
+ * @param int $access_id Default is ACCESS_PRIVATE
+ * @param bool $allow_multiple Allow multiple values for one key. Default is FALSE
*/
function create_metadata_from_array($entity_guid, array $name_and_values, $value_type, $owner_guid, $access_id = ACCESS_PRIVATE, $allow_multiple = false) {
foreach ($name_and_values as $k => $v) {