aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-11-28 21:24:42 -0500
committercash <cash.costello@gmail.com>2011-11-28 21:24:42 -0500
commit6cc08f83225237d0cd57e0a5c0ebec0a8327aa30 (patch)
tree2022651363d627f9989d4aca7370081e3d956463 /engine/lib
parent6ca01c470d695c8ae309ea3475899c14cc34dd73 (diff)
downloadelgg-6cc08f83225237d0cd57e0a5c0ebec0a8327aa30.tar.gz
elgg-6cc08f83225237d0cd57e0a5c0ebec0a8327aa30.tar.bz2
Fixes #3496 finished up this ticket by updating unit test and using more parantheses to make it clear how the OR/AND gets applied
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/river.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/engine/lib/river.php b/engine/lib/river.php
index 02d52dea1..421813441 100644
--- a/engine/lib/river.php
+++ b/engine/lib/river.php
@@ -207,6 +207,8 @@ function elgg_delete_river(array $options = array()) {
/**
* Get river items
*
+ * @note If using types and subtypes in a query, they are joined with an AND.
+ *
* @param array $options
* ids => INT|ARR River item id(s)
* subject_guids => INT|ARR Subject guid(s)
@@ -430,7 +432,6 @@ function elgg_river_get_access_sql() {
*
* @internal This is a simplified version of elgg_get_entity_type_subtype_where_sql()
* which could be used for all queries once the subtypes have been denormalized.
- * FYI: It allows types and subtypes to not be paired.
*
* @param string $table 'rv'
* @param NULL|array $types Array of types or NULL if none.
@@ -477,7 +478,7 @@ function elgg_get_river_type_subtype_where_sql($table, $types, $subtypes, $pairs
}
if (is_array($subtypes_wheres) && count($subtypes_wheres)) {
- $subtypes_wheres = array(implode(' OR ', $subtypes_wheres));
+ $subtypes_wheres = array('(' . implode(' OR ', $subtypes_wheres) . ')');
}
$wheres = array(implode(' AND ', array_merge($types_wheres, $subtypes_wheres)));