public function release(RevisionInterface $revision, UserInterface $user, $comment)
    {
        $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction();
        try {
            if ($revision->getReleasedAt() != null) {
                $this->revisionRepository->remove($revision->getEnvironment()->getCurrentRevision());
                $revision = clone $revision;
                $revision->setReleasedAt($this->dateTimeFactory->now());
                $revision->setReleasedBy($user->getName());
                $revision->setComment($comment);
                $this->revisionRepository->add($revision);
            } else {
                $revision->setReleasedAt($this->dateTimeFactory->now());
                $revision->setReleasedBy($user->getName());
                $revision->setComment($comment);
                $this->revisionRepository->update($revision);
            }
            $newCurrentRevision = clone $revision;
            $this->revisionRepository->add($newCurrentRevision);
        } catch (ExceptionInterface $e) {
            $connection->rollback();
            throw $e;
        }
        $connection->commit();
        return $this;
    }
public function release(RevisionInterface $revision, UserInterface $user, $comment)
    {
        $connection = $this->revisionRepository->getDbAdapter()->getDriver()->getConnection()->beginTransaction();
        try {
            if ($revision->getReleasedAt() != null) {
                $this->revisionRepository->remove($revision->getEnvironment()->getCurrentRevision());
                $revision = clone $revision;
                $revision->setReleasedAt($this->dateTimeFactory->now());
                $revision->setReleasedBy($user->getName());
                $revision->setComment($comment);
                $this->revisionRepository->add($revision);
            } else {
                $revision->setReleasedAt($this->dateTimeFactory->now());
                $revision->setReleasedBy($user->getName());
                $revision->setComment($comment);
                $this->revisionRepository->update($revision);
            }
            $newCurrentRevision = clone $revision;
            $this->revisionRepository->add($newCurrentRevision);
        } catch (ExceptionInterface $e) {
            $connection->rollback();
            throw $e;
        }
        $connection->commit();
        return $this;
    }
public function release ( RevisionInterface $ revision , UserInterface $ user , $ comment ) { $ connection = $ this -> revisionRepository -> getDbAdapter ( ) -> getDriver ( ) -> getConnection ( ) -> beginTransaction ( ) ; try { if ( $ revision -> getReleasedAt ( ) != null ) { $ this -> revisionRepository -> remove ( $ revision -> getEnvironment ( ) -> getCurrentRevision ( ) ) ; $ revision = clone $ revision ; $ revision -> setReleasedAt ( $ this -> dateTimeFactory -> now ( ) ) ; $ revision -> setReleasedBy ( $ user -> getName ( ) ) ; $ revision -> setComment ( $ comment ) ; $ this -> revisionRepository -> add ( $ revision ) ; } else { $ revision -> setReleasedAt ( $ this -> dateTimeFactory -> now ( ) ) ; $ revision -> setReleasedBy ( $ user -> getName ( ) ) ; $ revision -> setComment ( $ comment ) ; $ this -> revisionRepository -> update ( $ revision ) ; } $ newCurrentRevision = clone $ revision ; $ this -> revisionRepository -> add ( $ newCurrentRevision ) ; } catch ( ExceptionInterface $ e ) { $ connection -> rollback ( ) ; throw $ e ; } $ connection -> commit ( ) ; return $ this ; }
Release specified revision and create a current revision from it.
If the revision had already been released, the current revision should be removed first.

@param RevisionInterface $revision
@param UserInterface     $user
@param string            $comment
@throws \Zend\Db\Exception\ExceptionInterface
@return RevisionService
Release specified revision and create a current revision from it . If the revision had already been released the current revision should be removed first .