aboutsummaryrefslogtreecommitdiff
path: root/lib/models/BlubberThread.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/BlubberThread.php')
-rw-r--r--lib/models/BlubberThread.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/models/BlubberThread.php b/lib/models/BlubberThread.php
index 8e6f816..056405b 100644
--- a/lib/models/BlubberThread.php
+++ b/lib/models/BlubberThread.php
@@ -1253,4 +1253,16 @@ class BlubberThread extends SimpleORMap implements PrivacyObject
return $sub_thread ?? null;
}
+
+ public static function findByParent_id(string $parent_id): array
+ {
+ $threads = self::findBySQL(
+ "parent_id = :parent_id ORDER BY mkdate ASC",
+ ['parent_id' => $parent_id]
+ );
+
+ return !empty($threads) ? array_map(function ($thread) {
+ return self::upgradeThread($thread);
+ }, $threads) : [];
+ }
}