Pimcore\Model\Document\PageSnippet\Dao::getLatestVersion PHP Method

getLatestVersion() public method

Get latest available version, using $force always returns a version no matter if it is the same as the published one
public getLatestVersion ( boolean $force = false ) : array
$force boolean
return array
    public function getLatestVersion($force = false)
    {
        $versionData = $this->db->fetchRow("SELECT id,date FROM versions WHERE cid = ? AND ctype='document' ORDER BY `id` DESC LIMIT 1", $this->model->getId());
        if ($versionData && $versionData["id"] && ($versionData["date"] > $this->model->getModificationDate() || $force)) {
            $version = Version::getById($versionData["id"]);
            return $version;
        }
        return;
    }