public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new ClientException('Invalid collection attribute type');
        }

        if ($key === self::ENTRY_ID) {
            $this->setId($value);

            return;
        }

        if ($key === self::ENTRY_NAME) {
            $this->setName($value);

            return;
        }

        if ($key === self::ENTRY_WAIT_SYNC) {
            $this->setWaitForSync($value);

            return;
        }

        if ($key === self::ENTRY_JOURNAL_SIZE) {
            $this->setJournalSize($value);

            return;
        }

        if ($key === self::ENTRY_IS_SYSTEM) {
            $this->setIsSystem($value);

            return;
        }

        if ($key === self::ENTRY_IS_VOLATILE) {
            $this->setIsVolatile($value);

            return;
        }

        if ($key === self::ENTRY_TYPE) {
            $this->setType($value);

            return;
        }

        if ($key === self::ENTRY_STATUS) {
            $this->setStatus($value);

            return;
        }

        if ($key === self::ENTRY_KEY_OPTIONS) {
            $this->setKeyOptions($value);

            return;
        }

        if ($key === self::ENTRY_NUMBER_OF_SHARDS) {
            $this->setNumberOfShards($value);

            return;
        }
        
        if ($key === self::ENTRY_REPLICATION_FACTOR) {
            $this->setReplicationFactor($value);

            return;
        }
        
        if ($key === self::ENTRY_SHARDING_STRATEGY) {
            $this->setShardingStrategy($value);

            return;
        }

        if ($key === self::ENTRY_SHARD_KEYS) {
            $this->setShardKeys($value);

            return;
        }
        // unknown attribute, will be ignored
    }
public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new ClientException('Invalid collection attribute type');
        }

        if ($key === self::ENTRY_ID) {
            $this->setId($value);

            return;
        }

        if ($key === self::ENTRY_NAME) {
            $this->setName($value);

            return;
        }

        if ($key === self::ENTRY_WAIT_SYNC) {
            $this->setWaitForSync($value);

            return;
        }

        if ($key === self::ENTRY_JOURNAL_SIZE) {
            $this->setJournalSize($value);

            return;
        }

        if ($key === self::ENTRY_IS_SYSTEM) {
            $this->setIsSystem($value);

            return;
        }

        if ($key === self::ENTRY_IS_VOLATILE) {
            $this->setIsVolatile($value);

            return;
        }

        if ($key === self::ENTRY_TYPE) {
            $this->setType($value);

            return;
        }

        if ($key === self::ENTRY_STATUS) {
            $this->setStatus($value);

            return;
        }

        if ($key === self::ENTRY_KEY_OPTIONS) {
            $this->setKeyOptions($value);

            return;
        }

        if ($key === self::ENTRY_NUMBER_OF_SHARDS) {
            $this->setNumberOfShards($value);

            return;
        }
        
        if ($key === self::ENTRY_REPLICATION_FACTOR) {
            $this->setReplicationFactor($value);

            return;
        }
        
        if ($key === self::ENTRY_SHARDING_STRATEGY) {
            $this->setShardingStrategy($value);

            return;
        }

        if ($key === self::ENTRY_SHARD_KEYS) {
            $this->setShardKeys($value);

            return;
        }
        // unknown attribute, will be ignored
    }
public function set ( $ key , $ value ) { if ( ! is_string ( $ key ) ) { throw new ClientException ( 'Invalid collection attribute type' ) ; } if ( $ key === self :: ENTRY_ID ) { $ this -> setId ( $ value ) ; return ; } if ( $ key === self :: ENTRY_NAME ) { $ this -> setName ( $ value ) ; return ; } if ( $ key === self :: ENTRY_WAIT_SYNC ) { $ this -> setWaitForSync ( $ value ) ; return ; } if ( $ key === self :: ENTRY_JOURNAL_SIZE ) { $ this -> setJournalSize ( $ value ) ; return ; } if ( $ key === self :: ENTRY_IS_SYSTEM ) { $ this -> setIsSystem ( $ value ) ; return ; } if ( $ key === self :: ENTRY_IS_VOLATILE ) { $ this -> setIsVolatile ( $ value ) ; return ; } if ( $ key === self :: ENTRY_TYPE ) { $ this -> setType ( $ value ) ; return ; } if ( $ key === self :: ENTRY_STATUS ) { $ this -> setStatus ( $ value ) ; return ; } if ( $ key === self :: ENTRY_KEY_OPTIONS ) { $ this -> setKeyOptions ( $ value ) ; return ; } if ( $ key === self :: ENTRY_NUMBER_OF_SHARDS ) { $ this -> setNumberOfShards ( $ value ) ; return ; } if ( $ key === self :: ENTRY_REPLICATION_FACTOR ) { $ this -> setReplicationFactor ( $ value ) ; return ; } if ( $ key === self :: ENTRY_SHARDING_STRATEGY ) { $ this -> setShardingStrategy ( $ value ) ; return ; } if ( $ key === self :: ENTRY_SHARD_KEYS ) { $ this -> setShardKeys ( $ value ) ; return ; } // unknown attribute, will be ignored }
Set a collection attribute

The key (attribute name) must be a string.

This will validate the value of the attribute and might throw an
exception if the value is invalid.

@throws ClientException

@param string $key   - attribute name
@param mixed  $value - value for attribute

@return void
Set a collection attribute