protected function unpublishOthers($entity) {
        if(!$entity->isHead()) {
            $head = $entity->getHead();
            if($head->isPublished()) {
                $head->unpublish();
                $this->persist($head, false);
            }
        }

        foreach($entity->getVersions() as $version) {
            if($version !== $entity && $version->isPublished()) {
                $version->unpublish();
                $this->persist($version, false);
            }
        }
    }