| @@ 198-211 (lines=14) @@ | ||
| 195 | /** |
|
| 196 | * {@inheritdoc} |
|
| 197 | */ |
|
| 198 | public function affectingStatement($query, $bindings = []) |
|
| 199 | { |
|
| 200 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
| 201 | if ($me->pretending()) { |
|
| 202 | return 0; |
|
| 203 | } |
|
| 204 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
| 205 | $query->consistency(\CouchbaseN1qlQuery::REQUEST_PLUS); |
|
| 206 | ||
| 207 | $bucket = $this->openBucket($this->bucket); |
|
| 208 | $result = $bucket->query($query, ['parameters' => $bindings]); |
|
| 209 | ||
| 210 | return (isset($result[0])) ? $result[0] : false; |
|
| 211 | }); |
|
| 212 | } |
|
| 213 | ||
| 214 | /** |
|
| @@ 220-234 (lines=15) @@ | ||
| 217 | * |
|
| 218 | * @return mixed |
|
| 219 | */ |
|
| 220 | public function positionalStatement($query, array $bindings = []) |
|
| 221 | { |
|
| 222 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
| 223 | if ($me->pretending()) { |
|
| 224 | return 0; |
|
| 225 | } |
|
| 226 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
| 227 | $query->consistency(\CouchbaseN1qlQuery::STATEMENT_PLUS); |
|
| 228 | $query->options['args'] = $bindings; |
|
| 229 | $bucket = $this->openBucket($this->bucket); |
|
| 230 | $result = $bucket->query($query); |
|
| 231 | ||
| 232 | return (isset($result[0])) ? $result[0] : false; |
|
| 233 | }); |
|
| 234 | } |
|
| 235 | ||
| 236 | /** |
|
| 237 | * {@inheritdoc} |
|