Gets the content link from the cache if it is there or loads it into the
cache if it is not there.

@param string $repositoryId
@param string $documentId
@return string|null
332111
public function loadContentLink($repositoryId, $documentId)
    {
        $result = $this->getRepositoryUrlCache()->getObjectUrl($repositoryId, $documentId, Constants::SELECTOR_CONTENT);
        return $result === null ? null : (string) $result;
    }
130023
public Document getDocument(Long documentId) throws DataAccessException {
        try {
            db.openConnection();
            return this.getDocument(documentId, false);
        } catch (SQLException ex) {
            throw new DataAccessException("Failed to load document: " + documentId, ex);
        } finally {
            db.closeConnection();
        }
    }
1187729
public function loadContent($contentId, Request $request)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);

        $mainLocation = null;
        if (!empty($contentInfo->mainLocationId)) {
            $mainLocation = $this->repository->getLocationService()->loadLocation($contentInfo->mainLocationId);
        }

        $contentType = $this->repository->getContentTypeService()->loadContentType($contentInfo->contentTypeId);

        $contentVersion = null;
        $relations = null;
        if ($this->getMediaType($request) === 'application/vnd.ez.api.content') {
            $languages = Language::ALL;
            if ($request->query->has('languages')) {
                $languages = explode(',', $request->query->get('languages'));
            }

            $contentVersion = $this->repository->getContentService()->loadContent($contentId, $languages);
            $relations = $this->repository->getContentService()->loadRelations($contentVersion->getVersionInfo());
        }

        $restContent = new Values\RestContent(
            $contentInfo,
            $mainLocation,
            $contentVersion,
            $contentType,
            $relations,
            $request->getPathInfo()
        );

        if ($contentInfo->mainLocationId === null) {
            return $restContent;
        }

        return new Values\CachedValue(
            $restContent,
            array('locationId' => $contentInfo->mainLocationId)
        );
    }
1342172
public function iGetEntityWithId($entityId)
    {
        $this->lastEntity = $this->entity;
        $this->entity = $this->repository->get($entityId);
    }
177588
protected function getNodeIdsInSite($siteId, DocumentManager $dm)
    {
        $qb = $dm->createQueryBuilder(Node::class)->hydrate(false);
        $qb->field('deleted')->equals(false)
            ->field('siteId')->equals($siteId)
            ->distinct('nodeId');

        return $qb->getQuery()->execute()->toArray();
    }
1077202
protected function getPathUrl($repositoryId, $path, $selector = null)
    {
        $result = $this->getRepositoryUrlCache()->getPathUrl($repositoryId, $path, $selector);

        if ($result === null) {
            $this->getRepositoriesInternal($repositoryId);
            $result = $this->getRepositoryUrlCache()->getPathUrl($repositoryId, $path, $selector);
        }

        if ($result === null) {
            throw new CmisObjectNotFoundException(
                sprintf(
                    'Unknown path! Repository: "%s" | Path: "%s" | Selector: "%s"',
                    $repositoryId,
                    $path,
                    $selector
                )
            );
        }

        return $result;
    }
1370572
private function getSectionId($locationId)
    {
        $location = $this->load($locationId);
        $locationContentInfo = $this->contentHandler->loadContentInfo($location->contentId);

        return $locationContentInfo->sectionId;
    }
303803
public function read(Resource\ResourceId $resourceId)
    {
        return $this->crudRepositoryAdapter->getResource($this->resourceType, $resourceId);
    }
789817
protected function getRepositoryUrl($repositoryId, $selector = null)
    {
        $result = $this->getRepositoryUrlCache()->getRepositoryUrl($repositoryId, $selector);

        if ($result === null) {
            $this->getRepositoriesInternal($repositoryId);
            $result = $this->getRepositoryUrlCache()->getRepositoryUrl($repositoryId, $selector);
        }

        if ($result === null) {
            throw new CmisObjectNotFoundException(
                sprintf(
                    'Unknown repository! Repository: "%s" | Selector: "%s"',
                    $repositoryId,
                    $selector
                )
            );
        }

        return $result;
    }
778415
private function getContentIdentifier($contentId)
    {
        $contentType = $this->contentTypeService->loadContentType(
            $this->contentService
                ->loadContent($contentId)
                ->contentInfo
                ->contentTypeId
        );

        return $contentType->identifier;
    }
30910
public function find($documentName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null) : ?object
    {
        $repository = $this->getRepository($documentName);
        if ($repository instanceof DocumentRepository) {
            return $repository->find($identifier, $lockMode, $lockVersion);
        }

        return $repository->find($identifier);
    }
220780
public function getItem(string $cacheId)
    {
        if (!$this->cache->has($cacheId)) {
            return null;
        }

        $data = $this->cache->get($cacheId);

        if (!is_array($data) || !array_key_exists('content', $data)) {
            return null;
        }

        return unserialize($data['content']);
    }
66876
Document createDocument(String id) throws RepositoryException
   {
      ItemData data = handler.getContext().getItemStateManager().getItemData(id);
      if (data == null)
      {
         throw new ItemNotFoundException("Item id=" + id + " not found");
      }
      if (!data.isNode())
      {
         throw new RepositoryException("Item with id " + id + " is not a node");
      }
      return createDocument((NodeData)data);

   }
720167
public function findDefaultByContentSubdomain( $contentId,
                                                   $subdomainId,
                                                   $locales = null )
    {
        return $this->getMapper()
                    ->findDefaultByContentSubdomain(
                        $contentId,
                        $subdomainId,
                        $locales
                    );
    }
598939
public function treeNode($treeId)
    {
        $tree = $this->contentTreeManager->findByTreeId($treeId);
        if (!$tree) {
            return null;
        }
        $request = $this->requestStack->getCurrentRequest();
        $tree->setLanguage($request->getLocale());
        $treeNode = $tree->get($treeId);

        return new ContentTreeContext($treeNode);
    }
510868
public function getContentById($id)
    {
        return $this->om->getRepository($this->configurationManager->getEntityClass('content'))->find($id);
    }
338756
public function findCacheById(int $id, int $siteId = null)
    {

        // Resolve siteId
        $siteId = SiteHelper::resolveSiteId($siteId);

        // Check if already in addToCache
        if ($this->isCachedById($id, $siteId)) {
            return $this->cacheById[$siteId][$id];
        }

        return null;
    }