private function getVersionedNodePath($document)
{
$path = $this->getDocumentId($document);
$metadata = $this->dm->getClassMetadata(get_class($document));
if (!$metadata->versionable) {
throw new InvalidArgumentException(sprintf("The document at path '%s' is not versionable", $path));
}
$node = $this->session->getNode($path);
$mixin = $metadata->versionable === 'simple' ? 'mix:simpleVersionable' : 'mix:versionable';
if (!$node->isNodeType($mixin)) {
$node->addMixin($mixin);
}
return $path;
}