Loads all block data.

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

@return array
544407
public function loadBlockData($blockId, int $status): array
    {
        $query = $this->getBlockSelectQuery();
        $query->where(
            $query->expr()->eq('b.id', ':id')
        )
        ->setParameter('id', $blockId, Type::INTEGER);

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

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }
614727
public function loadObjectStateListData($groupId)
    {
        $query = $this->createObjectStateFindQuery();
        $query->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'),
                $query->bindValue($groupId, null, \PDO::PARAM_INT)
            )
        )->orderBy($this->dbHandler->quoteColumn('priority', 'ezcobj_state'), $query::ASC);

        $statement = $query->prepare();
        $statement->execute();

        $rows = array();
        while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
            $rows[$row['ezcobj_state_id']][] = $row;
        }

        return array_values($rows);
    }
481641
public function getBlockById(int $blockId, int $siteId = null)
    {
        /** @var SuperTableBlock|null $block */
        $block = Craft::$app->getElements()->getElementById($blockId, SuperTableBlockElement::class, $siteId);

        return $block;
    }
1206015
public function getByStatus($status)
    {
        $components = [];

        foreach ($this->all() as $name => $component) {
            if ($component->isStatus($status)) {
                $components[$name] = $component;
            }
        }

        return $components;
    }
429365
public BlockInfo getBlockInfo(final long blockId) throws IOException {
    return retryRPC(() -> {
      return GrpcUtils.fromProto(
          mClient.getBlockInfo(GetBlockInfoPRequest.newBuilder().setBlockId(blockId).build())
              .getBlockInfo());
    });
  }
30052
public function loadBlock($id)
    {
        if (isset($this->blocksById[$id])) {
            return $this->blocksById[$id];
        }

        $contentId = $this->getStorageGateway()->getContentIdByBlockId($id);
        $content = $this->contentService->loadContent($contentId);

        foreach ($content->getFields() as $field) {
            if (!$field->value instanceof Value) {
                continue;
            }

            foreach ($field->value->page->zones as $zone) {
                foreach ($zone->blocks as $block) {
                    if ($block->id === $id) {
                        return $this->blocksById[$id] = $block;
                    }
                }
            }
        }

        throw new NotFoundException('Block', $id);
    }
1365284
public function indexOfFiles($blockId)
    {
        $this->authorize('readList', File::class);
        $input  = $this->validator->validate('files');
        $params = $this->processor->process($input)->getProcessedFields();
        $block  = $this->repository->getById($blockId);
        if (empty($block)) {
            return $this->respondNotFound();
        }
        $results = $this->fileRepository->getEntityFiles(
            $block,
            $params['filter'],
            $params['orderBy'],
            $params['page'],
            $params['perPage']
        );
        return $this->respondWithSuccess($results, new FileTransformer);
    }
735962
public function getAllBlockNames()
    {
        $ret = [ ];
        try {
            $result = $this->getSoapClient()->GetBlockNames();
        } catch ( SoapException $ex ) {
            throw new StatusException('Error while getting the list of all blocks in the active template' , $ex);
        }
        if ( isset($result->GetBlockNamesResult->string) ) {
            if ( is_array($result->GetBlockNamesResult->string) ) {
                $ret = $result->GetBlockNamesResult->string;
            } else {
                $ret[] = $result->GetBlockNamesResult->string;
            }
        }

        return $ret;
    }
278686
public function loadRolesForContentObjects($contentIds, $status = Role::STATUS_DEFINED)
    {
        try {
            return $this->innerGateway->loadRolesForContentObjects($contentIds);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
500141
public function loadTypeData($typeId, $status)
    {
        $q = $this->getLoadTypeQueryBuilder();
        $q
            ->where($q->expr()->eq('c.id', ':id'))
            ->andWhere($q->expr()->eq('c.version', ':version'))
            ->setParameter('id', $typeId, ParameterType::INTEGER)
            ->setParameter('version', $status, ParameterType::INTEGER);

        return $q->execute()->fetchAll();
    }
1032962
public function run($id, $status)
    {
        $model = $this->findModel($id);
        $model->load(Yii::$app->request->post());
        $changedStatus = $model->sendToStatus($status);
        $model->save();

        return $this->response(
            $changedStatus,
            $model
        );
    }
481512
public function loadTypeDataByRemoteId($remoteId, $status)
    {
        try {
            return $this->innerGateway->loadTypeDataByRemoteId($remoteId, $status);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
969942
public function getLastBuildByStatus($projectId = null, $status = Build::STATUS_SUCCESS)
    {
        $query = 'SELECT * FROM build WHERE project_id = :pid AND status = :status ORDER BY id DESC LIMIT 1';
        $stmt = Database::getConnection('read')->prepare($query);
        $stmt->bindValue(':pid', $projectId);
        $stmt->bindValue(':status', $status);

        if ($stmt->execute()) {
            if ($data = $stmt->fetch(\PDO::FETCH_ASSOC)) {
                return new Build($data);
            }
        } else {
            return array();
        }
    }
272133
public function loadObjectStateListData($groupId)
    {
        try {
            return $this->innerGateway->loadObjectStateListData($groupId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1308629
public function getBlock(?string $blockId = null): GetBlockResponse
    {
        $command = new GetBlockCommand($blockId);
        $response = $this->driver->executeCommand($command);

        return new GetBlockResponse($response->getRawData());
    }
984893
static function fetchByStatus( $statusID, $asObject = true )
    {
        if ( $statusID == 0 )
            return eZOrderStatus::createUndefined();
        return eZPersistentObject::fetchObject( eZOrderStatus::definition(),
                                                null,
                                                array( "status_id" => $statusID ),
                                                $asObject );
    }
44625
private function userBlocks(int $user_id, string $location): Collection
    {
        $rows = DB::table('block')
            ->where('user_id', '=', $user_id)
            ->where('location', '=', $location)
            ->orderBy('block_order')
            ->pluck('module_name', 'block_id');

        return $this->filterActiveBlocks($rows, $this->availableUserBlocks());
    }