public function setType($type)
    {
        if ($type === 'document') {
            $type = self::TYPE_DOCUMENT;
        } else if ($type === 'edge') {
            $type = self::TYPE_EDGE;
        }

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

        if ($type !== self::TYPE_DOCUMENT && $type !== self::TYPE_EDGE) {
            throw new ClientException('Invalid type used for collection');
        }

        assert(is_int($type));
        $this->_type = $type;
    }
public function setType($type)
    {
        if ($type === 'document') {
            $type = self::TYPE_DOCUMENT;
        } else if ($type === 'edge') {
            $type = self::TYPE_EDGE;
        }

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

        if ($type !== self::TYPE_DOCUMENT && $type !== self::TYPE_EDGE) {
            throw new ClientException('Invalid type used for collection');
        }

        assert(is_int($type));
        $this->_type = $type;
    }
public function setType ( $ type ) { if ( $ type === 'document' ) { $ type = self :: TYPE_DOCUMENT ; } else if ( $ type === 'edge' ) { $ type = self :: TYPE_EDGE ; } if ( $ this -> _type !== null && $ this -> _type !== $ type ) { throw new ClientException ( 'Should not update the type of an existing collection' ) ; } if ( $ type !== self :: TYPE_DOCUMENT && $ type !== self :: TYPE_EDGE ) { throw new ClientException ( 'Invalid type used for collection' ) ; } assert ( is_int ( $ type ) ) ; $ this -> _type = $ type ; }
Set the collection type.

This is useful before a collection is create() 'ed in order to set a different type than the normal one.
For example this must be set to 3 in order to create an edge-collection.

@throws ClientException

@param int $type - type = 2 -> normal collection, type = 3 -> edge-collection

@return void
Set the collection type .