original_string: public function upsert(array $values)
      {
          if (empty($values)) {
              return true;
          }
          $values = $this->detectValues($values);
          $bindings = [];
          foreach ($values as $record) {
              foreach ($record as $key => $value) {
                  $bindings[$key] = $value;
              }
          }
  
          $sql = $this->grammar->compileUpsert($this, $values);
  
          return $this->connection->upsert($sql, $bindings);
      }
code: public function upsert(array $values)
      {
          if (empty($values)) {
              return true;
          }
          $values = $this->detectValues($values);
          $bindings = [];
          foreach ($values as $record) {
              foreach ($record as $key => $value) {
                  $bindings[$key] = $value;
              }
          }
  
          $sql = $this->grammar->compileUpsert($this, $values);
  
          return $this->connection->upsert($sql, $bindings);
      }
code_tokens: public function upsert ( array $ values ) { if ( empty ( $ values ) ) { return true ; } $ values = $ this -> detectValues ( $ values ) ; $ bindings = [ ] ; foreach ( $ values as $ record ) { foreach ( $ record as $ key => $ value ) { $ bindings [ $ key ] = $ value ; } } $ sql = $ this -> grammar -> compileUpsert ( $ this , $ values ) ; return $ this -> connection -> upsert ( $ sql , $ bindings ) ; }
docstring: supported N1QL upsert query.
  
  @param array $values
  
  @return bool|mixed
docstring_tokens: supported N1QL upsert query .