Code Duplication    Length = 14-15 lines in 2 locations

engine/lib/deprecated-1.9.php 2 locations

@@ 450-463 (lines=14) @@
447
 * @return \ElggUser[]|false Either an array of \ElggUsers or false, depending on success
448
 * @deprecated 1.9 Use \ElggUser::getFriendsOf()
449
 */
450
function get_user_friends_of($user_guid, $subtype = ELGG_ENTITIES_ANY_VALUE, $limit = 10,
451
$offset = 0) {
452
	elgg_deprecated_notice(__FUNCTION__ . ' is deprecated. Use \ElggUser::getFriendsOf()', 1.9);
453
454
	return elgg_get_entities_from_relationship(array(
455
		'relationship' => 'friend',
456
		'relationship_guid' => $user_guid,
457
		'inverse_relationship' => true,
458
		'type' => 'user',
459
		'subtype' => $subtype,
460
		'limit' => $limit,
461
		'offset' => $offset
462
	));
463
}
464
465
/**
466
 * Adds a user to another user's friends list.
@@ 992-1006 (lines=15) @@
989
 * @return int The number of objects
990
 * @deprecated 1.9 Use elgg_get_entities_from_relationship()
991
 */
992
function count_user_friends_objects($user_guid, $subtype = ELGG_ENTITIES_ANY_VALUE,
993
$timelower = 0, $timeupper = 0) {
994
995
	elgg_deprecated_notice(__FUNCTION__ . ' is deprecated. Use elgg_get_entities_from_relationship()', 1.9);
996
	return elgg_get_entities_from_relationship(array(
997
		'type' => 'object',
998
		'subtype' => $subtype,
999
		'created_time_lower' => $timelower,
1000
		'created_time_upper' => $timeupper,
1001
		'relationship' => 'friend',
1002
		'relationship_guid' => $user_guid,
1003
		'relationship_join_on' => 'container_guid',
1004
		'count' => true,
1005
	));
1006
}
1007
1008
/**
1009
 * Displays a list of a user's friends' objects of a particular subtype, with navigation.