1
0
Fork 0

Use the new relation functions

This commit is contained in:
Michael 2020-08-03 18:21:56 +00:00
commit ee1cb93f3a
3 changed files with 3 additions and 33 deletions

View file

@ -22,9 +22,7 @@
namespace Friendica\Model;
use Exception;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
/**
* This class handles GlobalContact related functions
@ -138,32 +136,4 @@ LIMIT 1",
return Contact\Relation::listCommonFollows($sourceId, $targetPublicContact['id'] ?? 0, $condition, $limit, $start, $shuffle);
}
/**
* @param integer $uid user
* @param integer $cid cid
* @return integer
* @throws Exception
*/
public static function countAllFriends($uid, $cid)
{
$cids = Contact::getPublicAndUserContacID($cid, $uid);
return Contact\Relation::countFollows($cids['public'] ?? 0);
}
/**
* @param integer $uid user
* @param integer $cid cid
* @param integer $start optional, default 0
* @param integer $limit optional, default 80
* @return array
* @throws Exception
*/
public static function allFriends($uid, $cid, $start = 0, $limit = 80)
{
$cids = Contact::getPublicAndUserContacID($cid, $uid);
return Contact\Relation::listFollows($cids['public'] ?? 0, [], $limit, $start);
}
}