aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/relationships.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-07-06 18:22:32 -0400
committerCash Costello <cash.costello@gmail.com>2012-07-06 18:22:32 -0400
commite9df0780e7499f983ccb9d346d202343aa1b2c18 (patch)
tree0ae39043e4a0e85e5af0ff2ecaea26a6759d1d3a /engine/lib/relationships.php
parent1a3c2c3a1f5eacece62cd25a88d678df5aed65a5 (diff)
downloadelgg-e9df0780e7499f983ccb9d346d202343aa1b2c18.tar.gz
elgg-e9df0780e7499f983ccb9d346d202343aa1b2c18.tar.bz2
Fixes #3046 adds documentation for requesting entities that do not have metadata or relationships
Diffstat (limited to 'engine/lib/relationships.php')
-rw-r--r--engine/lib/relationships.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index f50c4a485..09d541e22 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -239,6 +239,15 @@ function get_entity_relationships($guid, $inverse_relationship = FALSE) {
* Also accepts all options available to elgg_get_entities() and
* elgg_get_entities_from_metadata().
*
+ * To ask for entities that do not have a particulat relationship to an entity,
+ * use a custom where clause like the following:
+ *
+ * $options['wheres'][] = "NOT EXISTS (
+ * SELECT 1 FROM {$db_prefix}entity_relationships
+ * WHERE guid_one = e.guid
+ * AND relationship = '$relationship'
+ * )";
+ *
* @see elgg_get_entities
* @see elgg_get_entities_from_metadata
*