Gets a rendition 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
@param string $streamId
@return string|null
169495
public function loadRenditionContentLink($repositoryId, $documentId, $streamId)
    {
        $result = $this->getRepositoryUrlCache()->getObjectUrl($repositoryId, $documentId, Constants::SELECTOR_CONTENT);
        if ($result !== null) {
            $result->getQuery()->modify([Constants::PARAM_STREAM_ID => $streamId]);
            $result = (string) $result;
        }
        return $result;
    }
843311
public function getDocumentById($documentId)
    {
        /* @var $query SearchQuery */
        $query = $this->queryBuilder->newSearchQuery($documentId)->useQueryFields(QueryFields::fromString('id'))->getQuery();
        $response = $this->search->search($query, 0, 1);
        $parsedData = $response->getParsedData();
        $resultDocument = isset($parsedData->response->docs[0]) ? $parsedData->response->docs[0] : null;

        if (!$resultDocument instanceof Document) {
            throw new \UnexpectedValueException("Response did not contain a valid Document object");
        }

        return $this->searchResultBuilder->fromApacheSolrDocument($resultDocument);
    }
824082
protected function set_file_sharing_anyone_with_link_can_read(\repository_onedrive\rest $client, $fileid) {

        $type = (isset($this->options['embed']) && $this->options['embed'] == true) ? 'embed' : 'view';
        $updateread = [
            'type' => $type,
            'scope' => 'anonymous'
        ];
        $params = ['fileid' => $fileid];
        $response = $client->call('create_link', $params, json_encode($updateread));
        if (empty($response->link)) {
            $details = 'Cannot update link sharing for the document: ' . $fileid;
            throw new repository_exception('errorwhilecommunicatingwith', 'repository', '', $details);
        }
        return $response->link->webUrl;
    }
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;
    }
359814
public function load($objectId)
    {
        //====================================================================//
        // Stack Trace
        Splash::log()->trace();
        //====================================================================//
        // Search in Repository
        $entity = $this->repository->find($objectId);
        //====================================================================//
        // Check Object Entity was Found
        if (!$entity) {
            return Splash::log()->errTrace(static::$NAME.' : Unable to load '.$objectId);
        }

        return $entity;
    }
727951
private function getFile($fileId)
    {
        if (!$fileId) {
            return null;
        }

        $volumeManager = $this->getContainer()->get('phlexible_media_manager.volume_manager');
        $volume = $volumeManager->getByFileId($fileId);
        $file = $volume->findFile($fileId);

        return $file;
    }
813461
private function getMedia($mediaId)
    {
        $page = $this->getDoctrine()
                ->getRepository('FulgurioLightCMSBundle:Media')
                ->findOneBy(array('id' => $mediaId));
        if ($page)
        {
            return $page;
        }
        throw new NotFoundHttpException(
            $this->get('translator')->trans('fulgurio.lightcms.medias.not_found', array(), 'admin')
        );
    }
769381
public function getStream($mediaId)
    {
        $response = $this->getHttp()->get(self::API_GET, ['media_id' => $mediaId]);

        return $response->getBody();
    }
1325071
public function fetchPermanentNews ($mediaID)
    {
        $stream = $this->doPermanentFetchToStream($mediaID, null);
        $json = json_decode(stream_get_contents($stream));

        return $this->expandNews($json->news_item, new Downloaded\News($mediaID, $json->update_time));
    }
1181601
public function delete($messageId, $documentId = null)
    {
        return $this->diadocApi->delete($this->boxId, $messageId, $documentId);
    }
796774
public static function fetchByNodeId( $nodeId )
    {
        $node = eZContentObjectTreeNode::fetch( $nodeId );
        if ( $node instanceof eZContentObjectTreeNode )
        {
            return self::fromNode( $node );
        }
        else
        {
            // @TODO Currently this exception is only in rest package. Needs to be fixed.
            throw new ezpContentNotFoundException( "Unable to find node with ID $nodeId" );
        }
    }
1252546
private Document cmisContent( String id ) {
        DocumentWriter writer = newDocument(ObjectId.toString(ObjectId.Type.CONTENT, id));

        org.apache.chemistry.opencmis.client.api.Document doc = (org.apache.chemistry.opencmis.client.api.Document)session.getObject(id);
        writer.setPrimaryType(NodeType.NT_RESOURCE);
        writer.setParent(id);

        ContentStream contentStream = doc.getContentStream();
        if (contentStream != null) {
            BinaryValue content = new CmisConnectorBinary(contentStream, getSourceName(), id, getMimeTypeDetector());
            writer.addProperty(JcrConstants.JCR_DATA, content);
            writer.addProperty(JcrConstants.JCR_MIME_TYPE, contentStream.getMimeType());
        }

        Property<Object> lastModified = doc.getProperty(PropertyIds.LAST_MODIFICATION_DATE);
        Property<Object> lastModifiedBy = doc.getProperty(PropertyIds.LAST_MODIFIED_BY);

        writer.addProperty(JcrLexicon.LAST_MODIFIED, properties.jcrValues(lastModified));
        writer.addProperty(JcrLexicon.LAST_MODIFIED_BY, properties.jcrValues(lastModifiedBy));

        return writer.document();
    }
1016268
private function getCachedData($locationId) {
    if (!self::DEBUG_MODE) {
      return NULL;
    }

    $cachedData = $this->cacheBackend->get(get_class($this) . '_embed_' . $locationId);
    if ($cachedData) {
      return $cachedData->data;
    }

    return NULL;
  }
942810
public function get($entityId = null)
    {
        if (null !== $entityId) {
            $entityId = '/'.$entityId;
        }


        $response = $this->client->get(sprintf('/entities%s', $entityId));

        return $this->decodeResponse($response);
    }
1080631
public ReadDocumentResponse readDocument(String documentId) {
        ReadDocumentRequest request = new ReadDocumentRequest();
        request.setDocumentId(documentId);
        return this.readDocument(request);
    }
489240
public function getGameDataChunkContent($region, $gameId, $chunkId)
    {
        return file_get_contents($this->getGameDataChunkPath($region, $gameId, $chunkId));
    }
359915
public function findOneByPageIdAndByLanguageId($pageId, $languageId)
    {
        $documentCollection = $this->findByPageIdAndByLanguageId($pageId, $languageId);
        return reset($documentCollection);
    }