public function getAllLinearVersions($document, $limit = -1)
    {
        $path = $this->getDocumentId($document);
        $metadata = $this->dm->getClassMetadata(get_class($document));

        if (!$metadata->versionable) {
            throw new InvalidArgumentException(sprintf("The document of type '%s' is not versionable", $metadata->getName()));
        }

        $versions = $this->session
            ->getWorkspace()
            ->getVersionManager()
            ->getVersionHistory($path)
            ->getAllLinearVersions();

        $result = [];
        foreach ($versions as $version) {
            /* @var $version VersionInterface */
            $result[$version->getName()] = [
                'name'    => $version->getName(),
                'labels'  => [],
                'created' => $version->getCreated(),
            ];
        }

        return $result;
    }