private function count_children_from_parent_recursively(array $postparents, int $postid) : int {
        if (!isset($postparents[$postid])) {
            // Post not found at all.
            return 0;
        }

        $count = 0;
        foreach ($postparents as $pid => $parentid) {
            if ($postid == $parentid) {
                $count += $this->count_children_from_parent_recursively($postparents, $pid) + 1;
            }
        }

        return $count;
    }