public function setStatus($status)
    {
        assert(is_int($status));

        if ($this->_status !== null && $this->_status !== $status) {
            throw new ClientException('Should not update the status of an existing collection');
        }

        if (!in_array(
            $status,
            [
                self::STATUS_NEW_BORN,
                self::STATUS_UNLOADED,
                self::STATUS_LOADED,
                self::STATUS_BEING_UNLOADED,
                self::STATUS_DELETED
            ], true
        )
        ) {
            throw new ClientException('Invalid status used for collection');
        }

        $this->_status = $status;
    }
public function setStatus($status)
    {
        assert(is_int($status));

        if ($this->_status !== null && $this->_status !== $status) {
            throw new ClientException('Should not update the status of an existing collection');
        }

        if (!in_array(
            $status,
            [
                self::STATUS_NEW_BORN,
                self::STATUS_UNLOADED,
                self::STATUS_LOADED,
                self::STATUS_BEING_UNLOADED,
                self::STATUS_DELETED
            ], true
        )
        ) {
            throw new ClientException('Invalid status used for collection');
        }

        $this->_status = $status;
    }
public function setStatus ( $ status ) { assert ( is_int ( $ status ) ) ; if ( $ this -> _status !== null && $ this -> _status !== $ status ) { throw new ClientException ( 'Should not update the status of an existing collection' ) ; } if ( ! in_array ( $ status , [ self :: STATUS_NEW_BORN , self :: STATUS_UNLOADED , self :: STATUS_LOADED , self :: STATUS_BEING_UNLOADED , self :: STATUS_DELETED ] , true ) ) { throw new ClientException ( 'Invalid status used for collection' ) ; } $ this -> _status = $ status ; }
Set the collection status.

This is useful before a collection is create()'ed in order to set a status.

@throws ClientException

@param int $status - statuses = 1 -> new born, status = 2 -> unloaded, status = 3 -> loaded, status = 4 -> being unloaded, status = 5 -> deleted

@return void
Set the collection status .