X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FPost.php;h=7b77276de83c38528a410958174d5f2a6da6915a;hb=2647514603852fe5fb9f47f0bf153dd20c124ce6;hp=902525f9922415b738ef85ae3bfdffbdc1dc45f1;hpb=5419d1d426792ab3b3ceb1948e1767e6b1af9dcd;p=friendica.git diff --git a/src/Model/Post.php b/src/Model/Post.php index 902525f992..7b77276de8 100644 --- a/src/Model/Post.php +++ b/src/Model/Post.php @@ -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 *