Skip to content

Commit

Permalink
fix issue #253
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteemann committed Oct 15, 2018
1 parent 69d557f commit 2f90d49
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/ArangoDBClient/DocumentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@ public function save($collection, $document, array $options = [])
*/
public function update(Document $document, array $options = [])
{
$documentId = $this->getDocumentId($document);

return $this->updateById($document, $documentId, $document, $options);
return $this->updateById($document->getCollectionId(), $this->getDocumentId($document), $document, $options);
}


Expand Down Expand Up @@ -485,10 +483,10 @@ protected function patch($url, $collection, $documentId, Document $document, arr
$headers['if-match'] = '"' . $revision . '"';
}
}

$url = UrlHelper::buildUrl($url, [$collection, $documentId]);
$url = UrlHelper::appendParamsUrl($url, $params);

$result = $this->getConnection()->patch($url, $this->json_encode_wrapper($document->getAllForInsertUpdate()), $headers);
$json = $result->getJson();
$document->setRevision($json[$_documentClass::ENTRY_REV]);
Expand Down

0 comments on commit 2f90d49

Please sign in to comment.