original_string: public function setType($type) {
          if (!in_array($type, [
              self::INSERT, self::MULTI_INSERT, self::SELECT, self::UPDATE, self::DELETE,
              self::TRUNCATE, self::CREATE_TABLE, self::CREATE_INDEX, self::DROP_TABLE, self::DROP_INDEX
          ], true)) {
              throw new UnsupportedTypeException(sprintf('Invalid query type %s', $type));
          }
  
          $this->_type = $type;
  
          // Reset data and binds when changing types
          $this->_data = [];
          $this->_bindings = [];
  
          return $this;
      }
code: public function setType($type) {
          if (!in_array($type, [
              self::INSERT, self::MULTI_INSERT, self::SELECT, self::UPDATE, self::DELETE,
              self::TRUNCATE, self::CREATE_TABLE, self::CREATE_INDEX, self::DROP_TABLE, self::DROP_INDEX
          ], true)) {
              throw new UnsupportedTypeException(sprintf('Invalid query type %s', $type));
          }
  
          $this->_type = $type;
  
          // Reset data and binds when changing types
          $this->_data = [];
          $this->_bindings = [];
  
          return $this;
      }
code_tokens: public function setType ( $ type ) { if ( ! in_array ( $ type , [ self :: INSERT , self :: MULTI_INSERT , self :: SELECT , self :: UPDATE , self :: DELETE , self :: TRUNCATE , self :: CREATE_TABLE , self :: CREATE_INDEX , self :: DROP_TABLE , self :: DROP_INDEX ] , true ) ) { throw new UnsupportedTypeException ( sprintf ( 'Invalid query type %s' , $ type ) ) ; } $ this -> _type = $ type ; // Reset data and binds when changing types $ this -> _data = [ ] ; $ this -> _bindings = [ ] ; return $ this ; }
docstring: Set the type of query.
  
  @param string $type
  @return $this
  @throws \Titon\Db\Exception\UnsupportedTypeException
docstring_tokens: Set the type of query .