aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/relationships.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/relationships.php')
-rw-r--r--engine/lib/relationships.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/engine/lib/relationships.php b/engine/lib/relationships.php
index d84e70bfb..c1f54472a 100644
--- a/engine/lib/relationships.php
+++ b/engine/lib/relationships.php
@@ -470,12 +470,14 @@ function remove_entity_relationships($guid_one, $relationship = "", $inverse = f
*
* @param int $guid
*/
-function get_entity_relationships($guid) {
+function get_entity_relationships($guid, $inverse_relationship = FALSE) {
global $CONFIG;
$guid = (int)$guid;
- $query = "SELECT * from {$CONFIG->dbprefix}entity_relationships where guid_one=$guid";
+ $where = ($inverse_relationship ? "guid_two='$guid'" : "guid_one='$guid'");
+
+ $query = "SELECT * from {$CONFIG->dbprefix}entity_relationships where {$where}";
return get_data($query, "row_to_elggrelationship");
}