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

getVersions() public method

Get available versions fot the object and return an array of them
public getVersions ( ) : array
return array
    public function getVersions()
    {
        $versionIds = $this->db->fetchCol("SELECT id FROM versions WHERE cid = ? AND ctype='document' ORDER BY `id` DESC", $this->model->getId());
        $versions = [];
        foreach ($versionIds as $versionId) {
            $versions[] = Version::getById($versionId);
        }
        $this->model->setVersions($versions);
        return $versions;
    }