src/Repository/Doctrine/Publishes.php
public function makeDraftOfVersion($entity, $flush = true) {
        $new = clone $entity;
        $new->setHead($entity->getHead());
        $new->publish();
        $this->persist($new, false);
        if($flush) {
            $this->entities->flush();
        }
    }
public function makeDraftOfVersion($entity, $flush = true) {
        $new = clone $entity;
        $new->setHead($entity->getHead());
        $new->publish();
        $this->persist($new, false);
        if($flush) {
            $this->entities->flush();
        }
    }
Makes a new version of the given entity.

@param  object  $entity the entity
@param  boolean $flush
@return object  The new version