code: public static function getType($name)
      {
          if ( ! isset(self::$_typeObjects[$name])) {
              if ( ! isset(self::$_typesMap[$name])) {
                  throw TypeException::unknownType($name);
              }
              self::$_typeObjects[$name] = new self::$_typesMap[$name]();
          }
  
          return self::$_typeObjects[$name];
      }
docs: Factory method to create type instances.
  Type instances are implemented as flyweights.
  
  @static
  @throws TypeException
  @param string $name The name of the type (as returned by getName()).
  @return \Doctrine\ODM\CouchDB\Types\Type