original_string: protected function _addCompound($type, Query $query) {
          if ($query->getType() !== self::SELECT) {
              throw new InvalidQueryException(sprintf('Only a select query can be used with %s', $type));
          }
  
          $query->attribute('compound', $type);
  
          $this->_compounds[] = $query;
  
          return $this;
      }
code: protected function _addCompound($type, Query $query) {
          if ($query->getType() !== self::SELECT) {
              throw new InvalidQueryException(sprintf('Only a select query can be used with %s', $type));
          }
  
          $query->attribute('compound', $type);
  
          $this->_compounds[] = $query;
  
          return $this;
      }
code_tokens: protected function _addCompound ( $ type , Query $ query ) { if ( $ query -> getType ( ) !== self :: SELECT ) { throw new InvalidQueryException ( sprintf ( 'Only a select query can be used with %s' , $ type ) ) ; } $ query -> attribute ( 'compound' , $ type ) ; $ this -> _compounds [ ] = $ query ; return $ this ; }
docstring: Add a new compound query. Only select queries can be used with compounds.
  
  @param string $type
  @param \Titon\Db\Query $query
  @return $this
  @throws \Titon\Db\Exception\InvalidQueryException
docstring_tokens: Add a new compound query . Only select queries can be used with compounds .