diff options
| author | FarbodZamani <53179227+ferishili@users.noreply.github.com> | 2025-11-21 08:48:52 +0100 |
|---|---|---|
| committer | FarbodZamani <53179227+ferishili@users.noreply.github.com> | 2025-11-21 08:48:52 +0100 |
| commit | 242f1348946b608e7ba066878360d7b6cb3eca09 (patch) | |
| tree | ad04240d791102ae2a4abc3d37fd1304c4178a00 | |
| parent | 4faa006ecb4380392dc5c9301f161d23f67719ac (diff) | |
add find by parent idoverhauling-blubber
| -rw-r--r-- | lib/models/BlubberThread.php | 12 |
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) : []; + } } |
