Code Duplication    Length = 19-19 lines in 2 locations

engine/classes/Elgg/Database/PrivateSettingsTable.php 1 location

@@ 114-132 (lines=19) @@
111
			$options['private_setting_name_value_pairs_operator'],
112
			$options['private_setting_name_prefix']);
113
114
		if ($clauses) {
115
			// merge wheres to pass to get_entities()
116
			if (isset($options['wheres']) && !is_array($options['wheres'])) {
117
				$options['wheres'] = [$options['wheres']];
118
			} elseif (!isset($options['wheres'])) {
119
				$options['wheres'] = [];
120
			}
121
122
			$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
123
124
			// merge joins to pass to get_entities()
125
			if (isset($options['joins']) && !is_array($options['joins'])) {
126
				$options['joins'] = [$options['joins']];
127
			} elseif (!isset($options['joins'])) {
128
				$options['joins'] = [];
129
			}
130
131
			$options['joins'] = array_merge($options['joins'], $clauses['joins']);
132
		}
133
134
		return $this->entities->getEntities($options);
135
	}

engine/classes/Elgg/Database/EntityTable.php 1 location

@@ 1177-1195 (lines=19) @@
1174
1175
		$clauses = _elgg_get_entity_attribute_where_sql($options);
1176
1177
		if ($clauses) {
1178
			// merge wheres to pass to elgg_get_entities()
1179
			if (isset($options['wheres']) && !is_array($options['wheres'])) {
1180
				$options['wheres'] = [$options['wheres']];
1181
			} elseif (!isset($options['wheres'])) {
1182
				$options['wheres'] = [];
1183
			}
1184
1185
			$options['wheres'] = array_merge($options['wheres'], $clauses['wheres']);
1186
1187
			// merge joins to pass to elgg_get_entities()
1188
			if (isset($options['joins']) && !is_array($options['joins'])) {
1189
				$options['joins'] = [$options['joins']];
1190
			} elseif (!isset($options['joins'])) {
1191
				$options['joins'] = [];
1192
			}
1193
1194
			$options['joins'] = array_merge($options['joins'], $clauses['joins']);
1195
		}
1196
1197
		return elgg_get_entities_from_relationship($options);
1198
	}