Get CurrentRevision.

@return \KmbDomain\Model\RevisionInterface
162248
public function getCurrentRevision()
    {
        if ($this->currentRevision === null) {
            $this->setCurrentRevision($this->revisionRepository->getCurrentByEnvironment($this));
        }
        return $this->currentRevision;
    }
879059
public function getConfigRevisionLimit() {
        $default = Config::get('revisionable.revisions.limit');
        if(is_null($this->revisionLimit)) {
            // the parameter is not set - default behaviour is to create revisions
            return $default;
        }

        if(! is_numeric($this->revisionLimit)) {
            return $default;
        }

        return $this->revisionLimit;
    }
563814
public function getCurrentVersion()
    {
        // We don't cache this code as the current version is pretty volatile.
        // TODO - that means they're no point in a setter then?
        // maybe we should cache and call a reset() method every time a migration is run
        $versions = $this->getVersions();
        $version = 0;

        if (!empty($versions)) {
            $version = end($versions);
        }

        $this->setCurrentVersion($version);

        return $this->currentVersion;
    }
541251
public function getCommonMetadata($revision = null)
	{
		// Without revision, use current info
		if (!isset($revision)) {
			return $this->info['commonmetadata'];
		}

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

		return $info['commonmetadata'];
	}
1104587
public function getCurrentResource()
    {
        if (!$this->currentResource) {
            $request = $this->container->make('request');
            $this->currentResource = $this->detector->resourceByRequest($request);
        }

        return $this->currentResource;
    }
930411
public function current()
    {
        if (!$this->page) {
            $this->page = $this->executeCall();
        }

        if (isset($this->page['prefixes'])) {
            $this->updatePrefixes();
        }

        return $this->get($this->itemsPath, $this->page);
    }
457174
public function getCurrentHomeDir()
    {
        if (($sValue = $this->getViewConfigParam('currenthomedir')) === null) {
            $sValue = $this->getConfig()->getCurrentShopUrl();
            $this->setViewConfigParam('currenthomedir', $sValue);
        }

        return $sValue;
    }
1103417
public function getActionsAttribute()
    {
        if (!$this->relationLoaded('actions')) {
            $this->load('actions');
        }

        return $this->getRelation('actions')->load('revisioned')->map(function ($revision) {
            if ($revisioned = $revision->revisioned) {
                return $revisioned->wrapRevision($revision);
            }

            return $revision;
        });
    }
639857
public function current()
    {
        $row = null;

        if ($this->valid()) {
            $row = $this->getRowData($this->index);
        }

        return $row;
    }
186529
public function getCurrentBranch()
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'rev-parse'}($this->getRepositoryPath(), array(
            '--symbolic-full-name',
            '--abbrev-ref',
            'HEAD'
        ));
        $result->assertSuccess(
            sprintf('Cannot retrieve current branch from "%s"', $this->getRepositoryPath())
        );

        return $result->getStdOut();
    }
106979
private function getRevisionId()
    {
        if (null === $this->revisionId) {
            $this->conn->insert(
                $this->config->getRevisionTableName(),
                [
                    'timestamp' => date_create('now'),
                    'username' => $this->config->getCurrentUsername(),
                ],
                [
                    Type::DATETIME,
                    Type::STRING,
                ]
            );

            $sequenceName = $this->platform->supportsSequences()
                ? $this->platform->getIdentitySequenceName($this->config->getRevisionTableName(), 'id')
                : null;

            $this->revisionId = $this->conn->lastInsertId($sequenceName);
        }

        return $this->revisionId;
    }
1128093
protected static function getMapCallback($revisioned)
    {
        // We need to pass the calling class to the closure scope
        // instead of calling new static(), since php is going
        // to instantiate it w/o late static binding (bug).
        $presenter = get_called_class();

        return function ($revision) use ($presenter, $revisioned) {
            return new $presenter($revision, $revisioned);
        };
    }
35850
public function current()
    {
        if ($this->mode & self::CURRENT_AS_RESOURCE) {
            return current($this->resources);
        }

        if ($this->mode & self::CURRENT_AS_PATH) {
            return current($this->resources)->getPath();
        }

        return current($this->resources)->getName();
    }
574834
protected function getCurrentRevision($page)
    {
        if (empty($page)) {
            return null;
        }
        $revision = $page->getCurrentRevision();
        if ($revision instanceof \Rcm\Entity\Revision) {
            return $revision->getRevisionId();
        }

        return null;
    }
218792
public function getCurrent()
    {
        if (is_null($this->current))
        {
            $siteView = $this->makeNewViewModel();

            $this->current = $siteView;
        }

        return $this->current;
    }
122052
public function getConfigRevisionForModel() {
        if(is_null($this->revisionEnabled)) {
            // the parameter is not set - default behaviour is to create revisions
            return true;
        }

        if($this->revisionEnabled === false) {
            return false;
        }
        return true;
    }
1201721
protected function fetchCurrentVersionUrl($currentVersionReference)
    {
        $versionResponse = $this->client->request(
            'GET',
            $currentVersionReference
        );

        if ($this->isErrorResponse($versionResponse)) {
            return $this->inputDispatcher->parse($versionResponse);
        }

        return $versionResponse->headers['Location'];
    }