public function addType(Type $type, $name = '')
    {
        if (!$name) {
            $name = (string)$type;
        }

        $this->types[$name] = $type;
    }
public function addType(Type $type, $name = '')
    {
        if (!$name) {
            $name = (string)$type;
        }

        $this->types[$name] = $type;
    }
public function addType ( Type $ type , $ name = '' ) { if ( ! $ name ) { $ name = ( string ) $ type ; } $ this -> types [ $ name ] = $ type ; }
Register a new type

@param Type $type
@param string $name An optional identifier for this type (defaults to 'name'
attribute in type definition). Needs to be unique in schema.
Register a new type