aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-17 19:43:49 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-02-17 19:43:49 +0000
commitb3012350e2d8dafaf696e2c472f8cf0ae5e1674b (patch)
treecc0dd15d97f2a8846448823eae1555d280e9623a /engine/lib/metadata.php
parentccb5a69319a6a367988534296c678c8abf322879 (diff)
downloadelgg-b3012350e2d8dafaf696e2c472f8cf0ae5e1674b.tar.gz
elgg-b3012350e2d8dafaf696e2c472f8cf0ae5e1674b.tar.bz2
Refs #1523: elgg_get_entities() uses the constants for defaults and conditionals. Added some tests to check for no subtypes. Updated the documentation.
git-svn-id: http://code.elgg.org/elgg/trunk@3946 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 70f582b4b..159e9187a 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -535,8 +535,11 @@ function find_metadata($meta_name = "", $meta_value = "", $entity_type = "", $en
/**
- * Returns entities based upon metadata.
+ * Returns entities based upon metadata. Also accepts all
+ * options available to elgg_get_entities(). Supports
+ * the singular option shortcut.
*
+ * @see elgg_get_entities
* @param array $options Array in format:
*
* metadata_names => NULL|ARR metadata names
@@ -553,12 +556,10 @@ function find_metadata($meta_name = "", $meta_value = "", $entity_type = "", $en
*/
function elgg_get_entities_from_metadata(array $options = array()) {
$defaults = array(
- 'metadata_names' => NULL,
- 'metadata_name' => NULL,
- 'metadata_values' => NULL,
- 'metadata_value' => NULL,
- 'metadata_name_value_pair' => NULL,
- 'metadata_name_value_pairs' => NULL,
+ 'metadata_names' => ELGG_ENTITIES_ANY_VALUE,
+ 'metadata_values' => ELGG_ENTITIES_ANY_VALUE,
+ 'metadata_name_value_pairs' => ELGG_ENTITIES_ANY_VALUE,
+
'metadata_name_value_pairs_operator' => 'AND',
'metadata_case_sensitive' => TRUE
);