aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-11 21:19:14 +0200
committerSem <sembrestels@riseup.net>2012-07-11 21:19:14 +0200
commitb83574ae1b8ada2bb9c2247492806473df920259 (patch)
tree30f9010da3cab12bda4921f079cfe86fcef2e7a4 /engine/lib/metadata.php
parent46bd104bd523c08ff2f6bc0342be9ae1251259e8 (diff)
parent4d42fd0263948eee4a7c7a26ceca0647c01cce32 (diff)
downloadelgg-b83574ae1b8ada2bb9c2247492806473df920259.tar.gz
elgg-b83574ae1b8ada2bb9c2247492806473df920259.tar.bz2
Merge tag '1.8.8' of git://github.com/Elgg/Elgg into lorea-preprod
Elgg 1.8.8 release Conflicts: js/lib/languages.js
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 0ff3a43dc..77fa30e41 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -361,13 +361,24 @@ function elgg_enable_metadata(array $options) {
* options available to elgg_get_entities(). Supports
* the singular option shortcut.
*
- * NB: Using metadata_names and metadata_values results in a
+ * @note Using metadata_names and metadata_values results in a
* "names IN (...) AND values IN (...)" clause. This is subtly
* differently than default multiple metadata_name_value_pairs, which use
* "(name = value) AND (name = value)" clauses.
*
* When in doubt, use name_value_pairs.
*
+ * To ask for entities that do not have a metadata value, use a custom
+ * where clause like this:
+ *
+ * $options['wheres'][] = "NOT EXISTS (
+ * SELECT 1 FROM {$dbprefix}metadata md
+ * WHERE md.entity_guid = e.guid
+ * AND md.name_id = $name_metastring_id
+ * AND md.value_id = $value_metastring_id)";
+ *
+ * Note the metadata name and value has been denormalized in the above example.
+ *
* @see elgg_get_entities
*
* @param array $options Array in format: