Loads all sub block IDs.

@param int|string $blockId
@param int $status

@return array
196673
public function loadSubBlockIds($blockId, ?int $status = null): array
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('DISTINCT id')
            ->from('ngbm_block')
            ->where(
                $query->expr()->like('path', ':path')
            )
            ->setParameter('path', '%/' . (int) $blockId . '/%', Type::STRING);

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

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

        return array_column($result, 'id');
    }
102829
public static function get_blockids_from_moduleid($moduleid) {
        global $DB;

        // Get the context of the module
        $contextid = context_module::instance($moduleid)->id;

        // Get all the block instances which parentcontextid is the module contextid
        $blockids = array();
        $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
        foreach ($instances as $instance) {
            $blockids[] = $instance->id;
        }
        return $blockids;
    }
679121
private function addStatusToOrder($id, $status)
    {
        $order = $this->_order->load($id);
        $order->addStatusToHistory($this->getStatusFromPaymentKey($status), null, true);
        $order->save();
    }
618565
protected function getStatus($statusId)
    {
        if (!isset($this->cachedStatuses[$statusId])) {
            $this->cachedStatuses[$statusId] = $this->statusRepository->findOneById($statusId);
        }

        return $this->cachedStatuses[$statusId];
    }
272101
protected function getObjectStateIds($contentId)
    {
        $objectStateIds = array();

        foreach ($this->objectStateHandler->loadAllGroups() as $objectStateGroup) {
            $objectStateIds[] = $this->objectStateHandler->getContentState(
                $contentId,
                $objectStateGroup->id
            )->id;
        }

        return $objectStateIds;
    }
220333
protected function updateJob(ObjectId $id, int $status): UpdateResult
    {
        $result = $this->db->{$this->job_queue}->updateMany([
            '_id' => $id,
            '$isolated' => true,
        ], [
            '$set' => [
                'status' => $status,
            ],
        ]);

        return $result;
    }
576791
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');
    }
1308629
public function getBlock(?string $blockId = null): GetBlockResponse
    {
        $command = new GetBlockCommand($blockId);
        $response = $this->driver->executeCommand($command);

        return new GetBlockResponse($response->getRawData());
    }
1050871
def get_scheduling_block(sub_array_id, block_id):
    """"""
    block_ids = DB.get_sub_array_sbi_ids(sub_array_id)
    if block_id in block_ids:
        block = DB.get_block_details([block_id]).__next__()
        return block, HTTPStatus.OK

    return dict(error="unknown id"), HTTPStatus.NOT_FOUND
572816
public function getByStatus($status)
    {
        return array_filter($this->slaves, function ($slave) use ($status) {
            return $status === Slave::ANY || $status === $slave->getStatus();
        });
    }
1044754
public function getAccounts(string $nodeId, ?string $blockId = null): GetAccountsResponse
    {
        $node = hexdec($nodeId);
        $command = new GetAccountsCommand($node, $blockId);
        $response = $this->driver->executeCommand($command);

        return new GetAccountsResponse($response->getRawData());
    }
1013641
public function load($contentTypeId, $status = Type::STATUS_DEFINED)
    {
        return $this->loadFromRows(
            $this->contentTypeGateway->loadTypeData($contentTypeId, $status),
            $contentTypeId,
            $status
        );
    }
91138
public function collectionExists($collectionId, int $status): bool
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('count(*) AS count')
            ->from('ngbm_collection')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $collectionId, Type::INTEGER);

        $this->applyStatusCondition($query, $status);

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

        return (int) ($data[0]['count'] ?? 0) > 0;
    }
578289
public function loadConditionData($conditionId, int $status): array
    {
        $query = $this->getConditionSelectQuery();
        $query->where(
            $query->expr()->eq('id', ':id')
        )
        ->setParameter('id', $conditionId, Type::INTEGER);

        $this->applyStatusCondition($query, $status);

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }
1179212
public function actionPreview($blockId)
    {
        $blockItem = Block::findOne($blockId);
        if (!$blockItem) {
            throw new NotFoundHttpException();
        }

        /** @var $blockObject \luya\cms\base\InternalBaseBlock */
        $blockObject = $blockItem->getObject('preview', 'admin-preview');

        return $blockObject->renderAdminPreview();
    }
698576
public function loadTypeDataByIdentifier($identifier, $status)
    {
        try {
            return $this->innerGateway->loadTypeDataByIdentifier($identifier, $status);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1259140
public function loadLayoutData($layoutId, int $status): array
    {
        $query = $this->getLayoutSelectQuery();
        $query->where(
            $query->expr()->eq('l.id', ':id')
        )
        ->setParameter('id', $layoutId, Type::INTEGER);

        $this->applyStatusCondition($query, $status, 'l.status');

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }