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

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