Use the new relation functions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user