Code Duplication    Length = 60-61 lines in 2 locations

engine/lib/deprecated-1.8.php 2 locations

@@ 1150-1209 (lines=60) @@
1147
 * @return array A list of entities.
1148
 * @deprecated 1.8 Use elgg_get_entities_from_location()
1149
 */
1150
function get_entities_in_area($lat, $long, $radius, $type = "", $subtype = "", $owner_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0, $container_guid = NULL) {
1151
	elgg_deprecated_notice('get_entities_in_area() was deprecated by elgg_get_entities_from_location()!', 1.8);
1152
1153
	$options = array();
1154
1155
	$options['latitude'] = $lat;
1156
	$options['longitude'] = $long;
1157
	$options['distance'] = $radius;
1158
1159
	// set container_guid to owner_guid to emulate old functionality
1160
	if ($owner_guid != "") {
1161
		if (is_null($container_guid)) {
1162
			$container_guid = $owner_guid;
1163
		}
1164
	}
1165
1166
	if ($type) {
1167
		$options['types'] = $type;
1168
	}
1169
1170
	if ($subtype) {
1171
		$options['subtypes'] = $subtype;
1172
	}
1173
1174
	if ($owner_guid) {
1175
		if (is_array($owner_guid)) {
1176
			$options['owner_guids'] = $owner_guid;
1177
		} else {
1178
			$options['owner_guid'] = $owner_guid;
1179
		}
1180
	}
1181
1182
	if ($container_guid) {
1183
		if (is_array($container_guid)) {
1184
			$options['container_guids'] = $container_guid;
1185
		} else {
1186
			$options['container_guid'] = $container_guid;
1187
		}
1188
	}
1189
1190
	$options['limit'] = $limit;
1191
1192
	if ($offset) {
1193
		$options['offset'] = $offset;
1194
	}
1195
1196
	if ($order_by) {
1197
		$options['order_by'];
1198
	}
1199
1200
	if ($site_guid) {
1201
		$options['site_guid'];
1202
	}
1203
1204
	if ($count) {
1205
		$options['count'] = $count;
1206
	}
1207
1208
	return elgg_get_entities_from_location($options);
1209
}
1210
1211
/**
1212
 * Return a list of entities suitable for display based on the given search criteria.
@@ 1872-1932 (lines=61) @@
1869
 * @return array A list of entities.
1870
 * @deprecated 1.8 Use elgg_get_entities_from_private_settings()
1871
 */
1872
function get_entities_from_private_setting($name = "", $value = "", $type = "", $subtype = "",
1873
$owner_guid = 0, $order_by = "", $limit = 10, $offset = 0, $count = false, $site_guid = 0,
1874
$container_guid = null) {
1875
	elgg_deprecated_notice('get_entities_from_private_setting() was deprecated by elgg_get_entities_from_private_setting()!', 1.8);
1876
1877
	$options = array();
1878
1879
	$options['private_setting_name'] = $name;
1880
	$options['private_setting_value'] = $value;
1881
1882
	// set container_guid to owner_guid to emulate old functionality
1883
	if ($owner_guid != "") {
1884
		if (is_null($container_guid)) {
1885
			$container_guid = $owner_guid;
1886
		}
1887
	}
1888
1889
	if ($type) {
1890
		$options['types'] = $type;
1891
	}
1892
1893
	if ($subtype) {
1894
		$options['subtypes'] = $subtype;
1895
	}
1896
1897
	if ($owner_guid) {
1898
		if (is_array($owner_guid)) {
1899
			$options['owner_guids'] = $owner_guid;
1900
		} else {
1901
			$options['owner_guid'] = $owner_guid;
1902
		}
1903
	}
1904
1905
	if ($container_guid) {
1906
		if (is_array($container_guid)) {
1907
			$options['container_guids'] = $container_guid;
1908
		} else {
1909
			$options['container_guid'] = $container_guid;
1910
		}
1911
	}
1912
1913
	$options['limit'] = $limit;
1914
1915
	if ($offset) {
1916
		$options['offset'] = $offset;
1917
	}
1918
1919
	if ($order_by) {
1920
		$options['order_by'];
1921
	}
1922
1923
	if ($site_guid) {
1924
		$options['site_guid'];
1925
	}
1926
1927
	if ($count) {
1928
		$options['count'] = $count;
1929
	}
1930
1931
	return elgg_get_entities_from_private_settings($options);
1932
}
1933
1934
/**
1935
 * Get entities based on their private data by multiple keys.