]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Question.php
Changed to null-coalscing style (??) as sugguested by @MrPetovan
[friendica.git] / src / Model / Post / Question.php
index 75de2925d33ff06f03fa0b11ae504f053472966e..db0d755b7fe47b1402a3b38a27ab3224b8b26331 100644 (file)
@@ -53,4 +53,14 @@ class Question
 
                return DBA::update('post-question', $fields, ['uri-id' => $uri_id], $insert_if_missing ? true : []);
        }
+
+       /**
+        * @param integer $id     Question ID
+        * @param array   $fields Array of selected fields, empty for all
+        * @return array|boolean  Question record if it exists, false otherwise
+        */
+       public static function getById($id, $fields = [])
+       {
+               return DBA::selectFirst('post-question', $fields, ['id' => $id]);
+       }
 }