From 242f1348946b608e7ba066878360d7b6cb3eca09 Mon Sep 17 00:00:00 2001 From: FarbodZamani <53179227+ferishili@users.noreply.github.com> Date: Fri, 21 Nov 2025 08:48:52 +0100 Subject: add find by parent id --- lib/models/BlubberThread.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) : []; + } } -- cgit v1.0