| @@ 338-352 (lines=15) @@ | ||
| 335 | /** |
|
| 336 | * {@inheritdoc} |
|
| 337 | */ |
|
| 338 | public function affectingStatement($query, $bindings = []) |
|
| 339 | { |
|
| 340 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
| 341 | if ($me->pretending()) { |
|
| 342 | return 0; |
|
| 343 | } |
|
| 344 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
| 345 | $query->consistency($this->consistency); |
|
| 346 | $query->namedParams(['parameters' => $bindings]); |
|
| 347 | $result = $this->executeQuery($query); |
|
| 348 | $this->metrics = (isset($result->metrics)) ? $result->metrics : []; |
|
| 349 | ||
| 350 | return (isset($result->rows[0])) ? $result->rows[0] : false; |
|
| 351 | }); |
|
| 352 | } |
|
| 353 | ||
| 354 | /** |
|
| 355 | * @param $query |
|
| @@ 360-374 (lines=15) @@ | ||
| 357 | * |
|
| 358 | * @return mixed |
|
| 359 | */ |
|
| 360 | public function positionalStatement($query, array $bindings = []) |
|
| 361 | { |
|
| 362 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
| 363 | if ($me->pretending()) { |
|
| 364 | return 0; |
|
| 365 | } |
|
| 366 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
| 367 | $query->consistency($this->consistency); |
|
| 368 | $query->positionalParams($bindings); |
|
| 369 | $result = $this->executeQuery($query); |
|
| 370 | $this->metrics = (isset($result->metrics)) ? $result->metrics : []; |
|
| 371 | ||
| 372 | return (isset($result->rows[0])) ? $result->rows[0] : false; |
|
| 373 | }); |
|
| 374 | } |
|
| 375 | ||
| 376 | /** |
|
| 377 | * {@inheritdoc} |
|