public function changeStatusTo(int $status): self
    {
        if (!in_array(
            $status,
            [VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED]
        )) {
            throw new InvalidArgumentException(
                '$status',
                'Status should be one of the following: STATUS_DRAFT, STATUS_PUBLISHED, STATUS_ARCHIVED'
            );
        }

        $this->targetVersionProperties['newStatus'] = $status;

        return $this;
    }
public function changeStatusTo(int $status): self
    {
        if (!in_array(
            $status,
            [VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED]
        )) {
            throw new InvalidArgumentException(
                '$status',
                'Status should be one of the following: STATUS_DRAFT, STATUS_PUBLISHED, STATUS_ARCHIVED'
            );
        }

        $this->targetVersionProperties['newStatus'] = $status;

        return $this;
    }
public function changeStatusTo ( int $ status ) : self { if ( ! in_array ( $ status , [ VersionInfo :: STATUS_DRAFT , VersionInfo :: STATUS_PUBLISHED , VersionInfo :: STATUS_ARCHIVED ] ) ) { throw new InvalidArgumentException ( '$status' , 'Status should be one of the following: STATUS_DRAFT, STATUS_PUBLISHED, STATUS_ARCHIVED' ) ; } $ this -> targetVersionProperties [ 'newStatus' ] = $ status ; return $ this ; }
Set intent to change Version status.

Supported: <code>VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED</code>

@see \eZ\Publish\API\Repository\Values\Content\VersionInfo

@param int $status

@return self

@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
Set intent to change Version status .