Load all page block data for block on page,
@param $pageId
@param $blockId
@param int $version
@param string $preloadBy
@return PageBlock[] array key is language_id
482777
public static function preloadPageBlock($pageId, $blockId, $version = 0, $preloadBy = 'page_id')
    {
        ($preloadBy == 'page_id') ? static::_preloadDataByPage($pageId, $version) : static::_preloadDataByBlock($blockId, $version);
        return static::_preloadGet('byVersionPage', [$version, $pageId, $blockId]) ?: [];
    }
112522
public function findElementsByPageId($pageId)
    {
        $this->makeSelect();
        $this->sql .= ' and page_element.page_id = ? order by block_key, element_sort';
        $this->bindValues[] = $pageId;

        return $this->find();
    }
1314750
private function preload($attributesByTag, $locale, $published = true)
    {
        $hrefsByType = [];
        foreach ($attributesByTag as $attributes) {
            $provider = $this->getValue($attributes, 'provider', self::DEFAULT_PROVIDER);
            if (!array_key_exists($provider, $hrefsByType)) {
                $hrefsByType[$provider] = [];
            }

            $hrefsByType[$provider][] = $attributes['href'];
        }

        $result = [];
        foreach ($hrefsByType as $provider => $hrefs) {
            $items = $this->linkProviderPool->getProvider($provider)->preload(
                array_unique($hrefs),
                $locale,
                $published
            );

            foreach ($items as $item) {
                $result[$provider . '-' . $item->getId()] = $item;
            }
        }

        return $result;
    }
769541
void loadBlock(BlockId blockId, ByteBuffer block) throws IOException {
        synchronized (m_accessLock) {
            if (! m_blockPathMap.containsKey(blockId)) {
                throw new IllegalArgumentException("Request to load block that is not stored: " + blockId);
            }

            int origPosition = block.position();
            block.position(0);
            Path blockPath = m_blockPathMap.get(blockId);
            try (SeekableByteChannel channel = Files.newByteChannel(blockPath)) {
                channel.read(block);
            }
            finally {
                block.position(origPosition);
            }
        }
    }
358510
public function ajaxUrl(PageBlockInterface $block, $parameters = [], $absolute = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        $parameters['blockId'] = $block->getId();

        if ($block->getPage() instanceof PageInterface) {
            $parameters['pageId'] = $block->getPage()->getId();
        }

        return $this->router->generate('sonata_page_ajax_block', $parameters, $absolute);
    }
1080622
public function loadChildBlocksData(Block $block, ?string $placeholder = null): array
    {
        $query = $this->getBlockSelectQuery();
        $query->where(
            $query->expr()->eq('b.parent_id', ':parent_id')
        )
        ->setParameter('parent_id', $block->id, Type::INTEGER)
        ->addOrderBy('b.placeholder', 'ASC')
        ->addOrderBy('b.position', 'ASC');

        if ($placeholder !== null) {
            $query->andWhere(
                $query->expr()->eq('b.placeholder', ':placeholder')
            )
            ->setParameter('placeholder', $placeholder, Type::STRING);
        }

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

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }
533624
private function getPlaceholders($navItemPageId, $placeholderVar, $prevId)
    {
        return (new Query())
            ->from('cms_nav_item_page_block_item t1')
            ->select(['t1.id', 't1.block_id', 't1.json_config_values', 't1.json_config_cfg_values', 't1.variation', 't2.class'])
            ->innerJoin('cms_block t2', 't2.id=t1.block_id')
            ->where(['nav_item_page_id' => $navItemPageId, 'placeholder_var' => $placeholderVar, 'prev_id' => $prevId, 'is_hidden' => 0])
            ->orderBy(['sort_index' => SORT_ASC])
            ->all();
    }
1320962
public function findTranslationOverlaysByPageId(int $pageId) : array
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->getRestrictions()->removeAll();
        $queryBuilder->getRestrictions()->add(GeneralUtility::makeInstance(DeletedRestriction::class));

        return $queryBuilder
            ->select('pid', 'l10n_parent', 'sys_language_uid')
            ->from('pages')
            ->add('where',
                $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT))
                . BackendUtility::BEenableFields('pages')
            )->execute()->fetchAll();

    }
160759
public function loadVersion($listId, $version, $params = [])
    {
        return $this->client()->get('lists/{listId}/{version}', ['listId' => $listId, 'version' => $version] + (array) $params);
    }
946449
public function getTemplateVersion( $templateId, $version ){
        $path = sprintf( self::PATH_TEMPLATE_VERSION_LOOKUP, $templateId, $version );

        return $this->httpGet( $path );
    }
1059052
public function loadRelations($contentId, $contentVersionNo = null, $relationType = null)
    {
        try {
            return $this->innerGateway->loadRelations($contentId, $contentVersionNo, $relationType);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
690478
function preloadDependencies(array $nodeIdList)
    {
        $siteIdList = [];

        $nodeList = parent::preloadDependencies($nodeIdList);

        foreach ($nodeList as $node) {
            foreach ($node->ucms_sites as $siteId) {
                $siteIdList[$siteId] = $siteId;
            }
        }

        if ($siteIdList) {
            $this->siteManager->getStorage()->loadAll($siteIdList);
        }

        return $nodeList;
    }
53862
public function getMethod($routeId, $version, $method)
    {
        if ($version == '*' || empty($version)) {
            $version = $this->methodTable->getLatestVersion($routeId);
        } else {
            $version = $this->methodTable->getVersion($routeId, $version);
        }

        if (empty($version)) {
            throw new StatusCode\UnsupportedMediaTypeException('Version does not exist');
        }

        return $this->methodTable->getMethod($routeId, $version, $method);
    }
423614
static function load($class_name, $object_id, $version)
	{
		static $cache = array();
		$hash = '__load:'.$class_name.'-'.$object_id.'-'.$version;
		if(!empty($cache[$hash]))
			return $cache[$hash];

		$object = bors_load($class_name, $object_id);
//		echo $object;
		foreach(bors_find_all(__CLASS__, array(
			'target_class_name' => $class_name,
			'target_id' => $object_id,
			'target_version' => $version,
		)) as $x)
		{
//			echo "{$x->property_name()} = {$x->value()}<br/>\n";
			$object->set_attr('versioning_properties',
				array_merge(
					$object->attr('versioning_properties', array()),
					array($x->property_name() => $object->get($x->property_name()))
				)
			);

			$object->set($x->property_name(), $x->value(), false);
//			$object->set_attr('versioning_property', $x->property_name());
		}

		return $cache[$hash] = $object;
	}
297113
public function loadContentInVersion($contentId, $versionNumber, Request $request)
    {
        $languages = Language::ALL;
        if ($request->query->has('languages')) {
            $languages = explode(',', $request->query->get('languages'));
        }

        $content = $this->repository->getContentService()->loadContent(
            $contentId,
            $languages,
            $versionNumber
        );
        $contentType = $this->repository->getContentTypeService()->loadContentType(
            $content->getVersionInfo()->getContentInfo()->contentTypeId
        );

        $versionValue = new Values\Version(
            $content,
            $contentType,
            $this->repository->getContentService()->loadRelations($content->getVersionInfo()),
            $request->getPathInfo()
        );

        if ($content->contentInfo->mainLocationId === null || $content->versionInfo->status === VersionInfo::STATUS_DRAFT) {
            return $versionValue;
        }

        return new Values\CachedValue(
            $versionValue,
            array('locationId' => $content->contentInfo->mainLocationId)
        );
    }
1121947
public static function preload_contexts_by_id(array $contextids) {
        global $DB;

        // Determine which contexts are not already cached.
        $tofetch = [];
        foreach ($contextids as $contextid) {
            if (!self::cache_get_by_id($contextid)) {
                $tofetch[] = $contextid;
            }
        }

        if (count($tofetch) > 1) {
            // There are at least two to fetch.
            // There is no point only fetching a single context as this would be no more efficient than calling the existing code.
            list($insql, $inparams) = $DB->get_in_or_equal($tofetch, SQL_PARAMS_NAMED);
            $ctxs = $DB->get_records_select('context', "id {$insql}", $inparams, '',
                    \context_helper::get_preload_record_columns_sql('{context}'));
            foreach ($ctxs as $ctx) {
                self::preload_from_record($ctx);
            }
        }
    }
975132
public function init($pageId, array $typoScriptSetup = [])
    {
        $this->setLanguageService($GLOBALS['LANG']);
        $pageId = (strpos($pageId, 'NEW') === 0) ? 0 : (int)$pageId;
        if ((int)$pageId < 0) {
            $pageId = Helper::getInstance()->getPidFromUid($pageId);
        }
        $this->realPid = $pageId;
        $this->loadLayoutSetup($pageId);
        foreach ($this->layoutSetup as $key => $setup) {
            $columns = $this->getLayoutColumns($key);
            if ($columns['allowed'] || $columns['disallowed'] || $columns['maxitems']) {
                $this->layoutSetup[$key]['columns'] = $columns;
                unset($this->layoutSetup[$key]['columns']['allowed']);
                $this->layoutSetup[$key]['allowed'] = $columns['allowed'] ?: [];
                $this->layoutSetup[$key]['disallowed'] = $columns['disallowed'] ?: [];
                $this->layoutSetup[$key]['maxitems'] = $columns['maxitems'] ?: [];
            }
        }
        $this->setTypoScriptSetup($typoScriptSetup);
        return $this;
    }