lib/Doctrine/CouchDB/CouchDBClient.php
public function putDocument($data, $id, $rev = null)
    {
        $data['_id'] = $id;
        if ($rev) {
            $data['_rev'] = $rev;
        }

        $path = '/'.$this->databaseName.'/'.urlencode($id);
        $response = $this->httpClient->request('PUT', $path, json_encode($data));

        if ($response->status != 201) {
            throw HTTPException::fromResponse($path, $response);
        }

        return [$response->body['id'], $response->body['rev']];
    }
public function putDocument($data, $id, $rev = null)
    {
        $data['_id'] = $id;
        if ($rev) {
            $data['_rev'] = $rev;
        }

        $path = '/'.$this->databaseName.'/'.urlencode($id);
        $response = $this->httpClient->request('PUT', $path, json_encode($data));

        if ($response->status != 201) {
            throw HTTPException::fromResponse($path, $response);
        }

        return [$response->body['id'], $response->body['rev']];
    }
public function putDocument ( $ data , $ id , $ rev = null ) { $ data [ '_id' ] = $ id ; if ( $ rev ) { $ data [ '_rev' ] = $ rev ; } $ path = '/' . $ this -> databaseName . '/' . urlencode ( $ id ) ; $ response = $ this -> httpClient -> request ( 'PUT' , $ path , json_encode ( $ data ) ) ; if ( $ response -> status != 201 ) { throw HTTPException :: fromResponse ( $ path , $ response ) ; } return [ $ response -> body [ 'id' ] , $ response -> body [ 'rev' ] ] ; }
Execute a PUT request against CouchDB inserting or updating a document.

@param array       $data
@param string      $id
@param string|null $rev

@throws HTTPException

@return array<id, rev>
Execute a PUT request against CouchDB inserting or updating a document .