Loads subcontents

@param  Revision $revision
@return Revision
169867
public function loadSubcontents(Revision $revision)
    {
        $content = $revision->getContent();
        if ($content instanceof ContentSet) {
            while ($subcontent = $revision->next()) {
                if (!($subcontent instanceof AbstractClassContent)) {
                    continue;
                }

                if ($this->_em->contains($subcontent)) {
                    continue;
                }

                $subcontent = $this->_em->find(get_class($subcontent), $subcontent->getUid());
            }
        } else {
            foreach ($revision->getData() as $key => $value) {
                if (is_array($value)) {
                    foreach ($value as &$val) {
                        if ($val instanceof AbstractClassContent) {
                            if (null !== $entity = $this->_em->find(get_class($val), $val->getUid())) {
                                $val = $entity;
                            }
                        }
                    }

                    unset($val);
                } elseif ($value instanceof AbstractClassContent) {
                    if (null !== $entity = $this->_em->find(get_class($value), $value->getUid())) {
                        $value = $entity;
                    }
                }

                $revision->$key = $value;
            }
        }

        return $revision;
    }
761677
protected function preparePage(
        Site $site,
        $page,
        $revisionId = null
    ) {
        if (empty($page)) {
            $page = $this->getNotFoundPage($site);
            $page->setCurrentRevision($page->getPublishedRevision());

            return $page;
        }

        $revision = $this->getRevision($site, $page, $revisionId);

        if (empty($revision)) {
            $page = $this->getNotFoundPage($site);
            $page->setCurrentRevision($page->getPublishedRevision());

            return $page;
        }

        $page->setCurrentRevision($revision);

        return $page;
    }
7224
public function patrol( Revision $revision ) {
		$this->api->postRequest( new SimpleRequest(
			'patrol', [
				'revid' => $revision->getId(),
				'token' => $this->getTokenForRevision( $revision ),
			] ) );
		return true;
	}
176296
private function _getObject($id, $revision = null)
    {
        if ($revision === null) {
            $select = Statement::get(
                'GET_CURRENT_OBJECT',
                [
                    '@collection' => $this->_name,
                    '@id' => $this->_connector->quote($id)
                ]
            );
            $record = $this->_connector->query($select)->fetch();
            if ($record) {
                return json_decode($record['obj']);
            }
        }
        return null;
    }
1020259
public function getSize($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return (int)$this->info['size'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return -1;
		}

		return (int)$info['size'];
	}
241373
public function setPublishedRevision(Revision $revision)
    {
        if (!empty($this->stagedRevision)) {
            $this->removeStagedRevision();
        }

        $revision->publishRevision();
        $this->publishedRevision = $revision;
        $this->publishedRevisionId = $revision->getRevisionId();
        $this->setLastPublished(new \DateTime());
    }
606123
public function getContent()
    {
        $content = null;
        if (0 < $this->revisions->count()) {
            $content = $this->revisions->get(0)->getContent();
        }

        return $content;
    }
858692
private function getTokenForRevision( Revision $revision ) {
		$result = $this->api->postRequest(
			new SimpleRequest(
				'query', [
				'prop' => 'revisions',
				'revids' => $revision->getId(),
				'rvtoken' => 'rollback',
			]
			)
		);
		$result = array_shift( $result['query']['pages'] );

		return $result['revisions'][0]['rollbacktoken'];
	}
130585
public function getSha1($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['sha1'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['sha1'];
	}
904878
def transform_revision(self, revision):
        """"""
        config = self.manager.get_source('config')
        return config.load_resource(revision)
498720
public function load(User $user = null): self
    {
        try {
            $contentDrafts = $this->contentService->loadContentDrafts($user);
        } catch (UnauthorizedException $e) {
            // if user has no access content/versionread for one of versions, exception is caught and draft array is empty
            $contentDrafts = [];
        }

        $contentDrafts = array_filter($contentDrafts, function (VersionInfo $version) {
            // Filter out content that has been sent to trash
            return !$version->getContentInfo()->isTrashed();
        });

        $contentTypes = $contentTypeIds = [];
        foreach ($contentDrafts as $contentDraft) {
            $contentTypeIds[] = $contentDraft->getContentInfo()->contentTypeId;
        }

        if (!empty($contentTypeIds)) {
            $contentTypes = $this->contentTypeService->loadContentTypeList(array_unique($contentTypeIds));
        }

        // ContentService::loadContentDrafts returns unsorted list of VersionInfo.
        // Sort results by modification date, descending.
        usort($contentDrafts, function (VersionInfo $a, VersionInfo $b) {
            return $b->modificationDate <=> $a->modificationDate;
        });

        $this->data = array_map(
            function (VersionInfo $versionInfo) use ($contentTypes) {
                return $this->mapContentDraft(
                    $versionInfo,
                    $contentTypes[$versionInfo->getContentInfo()->contentTypeId]
                );
            },
            $contentDrafts
        );

        return $this;
    }
441905
public function fromStringForRepository(string $something, CheckedOutRepository $repository) : Revision
    {
        return Revision::fromSha1(
            (new Process(['git', 'rev-parse', $something]))
                ->setWorkingDirectory($repository->__toString())
                ->mustRun()
                ->getOutput()
        );
    }
745511
public function getComment($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['comment'];
		}

		// Obtain the properties of the revision
		if (($info = $this->getRevision($revision)) === null) {
			return null;
		}

		return $info['comment'];
	}
1064438
public function get_items( $request ) {

		$parent = $this->get_post( $request['parent'] );
		if ( ! $request['parent'] || ! $parent || $this->parent_post_type !== $parent->post_type ) {
			return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent id.' ), array( 'status' => 404 ) );
		}

		$revisions = wp_get_post_revisions( $request['parent'] );

		$response = array();
		foreach ( $revisions as $revision ) {
			$data = $this->prepare_item_for_response( $revision, $request );
			$response[] = $this->prepare_response_for_collection( $data );
		}
		return rest_ensure_response( $response );
	}
181892
private function getResponsibleInfo($revision)
    {
        $username = $this->getResponsibleUsername($revision);
        return '<span title="'. $username . ' (' . $revision->user_id  . ')' . '" class="responsibleUser" 
            model="' . $revision->revisionable_type . '">' . $username . '</span>';
    }
1212838
public function getRevisionLink(Page $page, RevisionEntity $revision)
    {
        $view = $this->getView();

        $revisionId = $revision->getRevisionId();

        $publishedId = $page->getPublishedRevision();
        $stagedId = $page->getStagedRevision();

        if ((!empty($publishedId) && $publishedId->getRevisionId() == $revision->getRevisionId())
            || (!empty($stagedId) && $stagedId->getRevisionId() == $revision->getRevisionId())
        ) {
            $revisionId = null;
        }

        $html = '<a href="'.$view->urlToPage($page->getName(), $page->getPageType(), $revisionId).'">';
        $html .= $this->getRevisionType($page, $revision).' - '.$revision->getAuthor();
        $html .= '</a>';

        return $html;
    }
823345
public function log($path, $revision=null, $limit=null)
    {
        return $this->execute('log', array(
                '-r' => $revision ? $revision : false,
                '--limit' => $limit ? $limit : false,
                '--xml' => true,
                $this->getSvnUrl($path)
                )
        );
    }