]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post.php
Merge pull request #10024 from annando/block-tags
[friendica.git] / src / Model / Post.php
index bb35f126b34a981539da2e9de81aeecb1d022d5c..3727d29a36860d600b05072f9e088ba92f435f34 100644 (file)
@@ -181,6 +181,31 @@ class Post
                }
        }
 
+       /**
+        * Retrieve a single record from the post-thread table and returns it in an associative array
+        *
+        * @param array $fields
+        * @param array $condition
+        * @param array $params
+        * @return bool|array
+        * @throws \Exception
+        * @see   DBA::select
+        */
+       public static function selectFirstThread(array $fields = [], array $condition = [], $params = [])
+       {
+               $params['limit'] = 1;
+
+               $result = self::selectThread($fields, $condition, $params);
+
+               if (is_bool($result)) {
+                       return $result;
+               } else {
+                       $row = self::fetch($result);
+                       DBA::close($result);
+                       return $row;
+               }
+       }
+
        /**
         * Select rows from the post table and returns them as an array
         *