public function loadBlockCollectionIds(array $blockIds, ?int $status = null): array
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('DISTINCT bc.collection_id')
            ->from('ngbm_block_collection', 'bc')
            ->where(
                $query->expr()->in('bc.block_id', [':block_id'])
            )
            ->setParameter('block_id', $blockIds, Connection::PARAM_INT_ARRAY);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status, 'bc.block_status', 'block_status');
        }

        $result = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return array_column($result, 'collection_id');
    }