public function commit()
    {
        if (self::STATE_ADDED === $this->getState() || self::STATE_MODIFIED === $this->getState()) {
            $this->setRevision($this->getRevision() + 1);
            $this->setState(self::STATE_COMMITTED);
        } elseif (self::STATE_CONFLICTED === $this->getState()) {
            throw new Exception\ClassContentException(
                'Content is in conflict, resolve or revert it',
                Exception\ClassContentException::REVISION_CONFLICTED
            );
        } else {
            throw new ClassContentException(
                sprintf('Content can not be commited (state : %s)', $this->getState()),
                ClassContentException::REVISION_UPTODATE
            );
        }

        return $this;
    }
public function commit()
    {
        if (self::STATE_ADDED === $this->getState() || self::STATE_MODIFIED === $this->getState()) {
            $this->setRevision($this->getRevision() + 1);
            $this->setState(self::STATE_COMMITTED);
        } elseif (self::STATE_CONFLICTED === $this->getState()) {
            throw new Exception\ClassContentException(
                'Content is in conflict, resolve or revert it',
                Exception\ClassContentException::REVISION_CONFLICTED
            );
        } else {
            throw new ClassContentException(
                sprintf('Content can not be commited (state : %s)', $this->getState()),
                ClassContentException::REVISION_UPTODATE
            );
        }

        return $this;
    }
public function commit ( ) { if ( self :: STATE_ADDED === $ this -> getState ( ) || self :: STATE_MODIFIED === $ this -> getState ( ) ) { $ this -> setRevision ( $ this -> getRevision ( ) + 1 ) ; $ this -> setState ( self :: STATE_COMMITTED ) ; } elseif ( self :: STATE_CONFLICTED === $ this -> getState ( ) ) { throw new Exception \ ClassContentException ( 'Content is in conflict, resolve or revert it' , Exception \ ClassContentException :: REVISION_CONFLICTED ) ; } else { throw new ClassContentException ( sprintf ( 'Content can not be commited (state : %s)' , $ this -> getState ( ) ) , ClassContentException :: REVISION_UPTODATE ) ; } return $ this ; }
Updates current revision state and revision to be ready for commit.

@return self
Updates current revision state and revision to be ready for commit .