@@ 979-997 (lines=19) @@ | ||
976 | ||
977 | $clauses = _elgg_get_entity_attribute_where_sql($options); |
|
978 | ||
979 | if ($clauses) { |
|
980 | // merge wheres to pass to elgg_get_entities() |
|
981 | if (isset($options['wheres']) && !is_array($options['wheres'])) { |
|
982 | $options['wheres'] = array($options['wheres']); |
|
983 | } elseif (!isset($options['wheres'])) { |
|
984 | $options['wheres'] = array(); |
|
985 | } |
|
986 | ||
987 | $options['wheres'] = array_merge($options['wheres'], $clauses['wheres']); |
|
988 | ||
989 | // merge joins to pass to elgg_get_entities() |
|
990 | if (isset($options['joins']) && !is_array($options['joins'])) { |
|
991 | $options['joins'] = array($options['joins']); |
|
992 | } elseif (!isset($options['joins'])) { |
|
993 | $options['joins'] = array(); |
|
994 | } |
|
995 | ||
996 | $options['joins'] = array_merge($options['joins'], $clauses['joins']); |
|
997 | } |
|
998 | ||
999 | return elgg_get_entities_from_relationship($options); |
|
1000 | } |
@@ 100-118 (lines=19) @@ | ||
97 | $options['private_setting_name_value_pairs_operator'], |
|
98 | $options['private_setting_name_prefix']); |
|
99 | ||
100 | if ($clauses) { |
|
101 | // merge wheres to pass to get_entities() |
|
102 | if (isset($options['wheres']) && !is_array($options['wheres'])) { |
|
103 | $options['wheres'] = array($options['wheres']); |
|
104 | } elseif (!isset($options['wheres'])) { |
|
105 | $options['wheres'] = array(); |
|
106 | } |
|
107 | ||
108 | $options['wheres'] = array_merge($options['wheres'], $clauses['wheres']); |
|
109 | ||
110 | // merge joins to pass to get_entities() |
|
111 | if (isset($options['joins']) && !is_array($options['joins'])) { |
|
112 | $options['joins'] = array($options['joins']); |
|
113 | } elseif (!isset($options['joins'])) { |
|
114 | $options['joins'] = array(); |
|
115 | } |
|
116 | ||
117 | $options['joins'] = array_merge($options['joins'], $clauses['joins']); |
|
118 | } |
|
119 | ||
120 | return $this->entities->getEntities($options); |
|
121 | } |