From e9df0780e7499f983ccb9d346d202343aa1b2c18 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 6 Jul 2012 18:22:32 -0400 Subject: Fixes #3046 adds documentation for requesting entities that do not have metadata or relationships --- engine/lib/relationships.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engine/lib/relationships.php') 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 * -- cgit v1.2.3