mirror of
https://github.com/friendica/friendica
synced 2025-04-29 03:04:22 +02:00
New founction to count threads
This commit is contained in:
parent
c972cce740
commit
178bc543e3
5 changed files with 44 additions and 20 deletions
|
@ -156,6 +156,27 @@ class Post
|
|||
return DBA::count('post-user-view', $condition, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the post-thread-user-view records satisfying the provided condition
|
||||
*
|
||||
* @param array $condition array of fields for condition
|
||||
* @param array $params Array of several parameters
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* Example:
|
||||
* $condition = ["uid" => 1, "network" => 'dspr'];
|
||||
* or:
|
||||
* $condition = ["`uid` = ? AND `network` IN (?, ?)", 1, 'dfrn', 'dspr'];
|
||||
*
|
||||
* $count = Post::count($condition);
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function countThread(array $condition = [], array $params = [])
|
||||
{
|
||||
return DBA::count('post-thread-user-view', $condition, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the post-view records satisfying the provided condition
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue