Permalink
Browse files

Use cas during update

  • Loading branch information...
1 parent a3b70db commit 2e4bcaac89d96a2cec94f0c1e2b3dcf317798996 @trondn committed Dec 10, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 beers/save.php
View
@@ -1,6 +1,6 @@
<?php
$cb = getCouchbaseHandle();
-$beer = $cb->get($id);
+$beer = $cb->get($id, $cas);
$obj = json_decode($beer);
/* Insert the updated values */
@@ -14,7 +14,7 @@
$obj->upc = $_POST["beer_upc"];
$obj->brewery_id = $_POST["beer_brewery_id"];
-if ($cb->set($id, json_encode($obj))) {
+if ($cb->set($id, json_encode($obj), $cas)) {
echo "<h3>\"" . $obj->name . "\" successfully updated</h3>";
} else {
?>

0 comments on commit 2e4bcaa

Please sign in to comment.