]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post.php
Detection of local requests
[friendica.git] / src / Model / Post.php
index 902525f9922415b738ef85ae3bfdffbdc1dc45f1..7b77276de83c38528a410958174d5f2a6da6915a 100644 (file)
@@ -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
         *