public function makeHeadVersion($entity) {
        if($entity->isHead()) {
            return false;
        }

        $oldHead = $entity->getHead();

        // update references on all old versions
        $this->entities->createQueryBuilder()
            ->update($this->entityName, 'o')
            ->set('o.headVersion', ':newHead')
            ->where('o.headVersion = :oldHead')
            ->setParameter('newHead', $entity)
            ->setParameter('oldHead', $oldHead)
            ->getQuery()
            ->execute();

        // make the old head now just a sub-version
        $oldHead->setHead($entity);
        $this->persist($oldHead, false);

        // make this entity the head
        $entity->setHead(null);
        $this->persist($entity, false);

        $this->entities->flush();
        return true;
    }