public function setPublishedRevision(Revision $revision)
    {
        if (!empty($this->stagedRevision)) {
            $this->removeStagedRevision();
        }

        $revision->publishRevision();
        $this->publishedRevision = $revision;
        $this->publishedRevisionId = $revision->getRevisionId();
        $this->setLastPublished(new \DateTime());
    }