original_string: protected function _renderUnion($sql)
      {
          if ($this->_parts[self::UNION]) {
              $parts = count($this->_parts[self::UNION]);
              foreach ($this->_parts[self::UNION] as $cnt => $union) {
                  list($target, $type) = $union;
                  if ($target instanceof Zend_Db_Select) {
                      $target = $target->assemble();
                  }
                  $sql .= $target;
                  if ($cnt < $parts - 1) {
                      $sql .= ' ' . $type . ' ';
                  }
              }
          }
  
          return $sql;
      }
code: protected function _renderUnion($sql)
      {
          if ($this->_parts[self::UNION]) {
              $parts = count($this->_parts[self::UNION]);
              foreach ($this->_parts[self::UNION] as $cnt => $union) {
                  list($target, $type) = $union;
                  if ($target instanceof Zend_Db_Select) {
                      $target = $target->assemble();
                  }
                  $sql .= $target;
                  if ($cnt < $parts - 1) {
                      $sql .= ' ' . $type . ' ';
                  }
              }
          }
  
          return $sql;
      }
code_tokens: protected function _renderUnion ( $ sql ) { if ( $ this -> _parts [ self :: UNION ] ) { $ parts = count ( $ this -> _parts [ self :: UNION ] ) ; foreach ( $ this -> _parts [ self :: UNION ] as $ cnt => $ union ) { list ( $ target , $ type ) = $ union ; if ( $ target instanceof Zend_Db_Select ) { $ target = $ target -> assemble ( ) ; } $ sql .= $ target ; if ( $ cnt < $ parts - 1 ) { $ sql .= ' ' . $ type . ' ' ; } } } return $ sql ; }
docstring: Render UNION query
  
  @param string   $sql SQL query
  @return string
docstring_tokens: Render UNION query