| @@ 215-228 (lines=14) @@ | ||
| 212 | /** |
|
| 213 | * {@inheritdoc} |
|
| 214 | */ |
|
| 215 | public function affectingStatement($query, $bindings = []) |
|
| 216 | { |
|
| 217 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
| 218 | if ($me->pretending()) { |
|
| 219 | return 0; |
|
| 220 | } |
|
| 221 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
| 222 | $query->consistency($this->consistency); |
|
| 223 | $bucket = $this->openBucket($this->bucket); |
|
| 224 | $result = $bucket->query($query, ['parameters' => $bindings]); |
|
| 225 | ||
| 226 | return (isset($result[0])) ? $result[0] : false; |
|
| 227 | }); |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * @param $query |
|
| @@ 236-250 (lines=15) @@ | ||
| 233 | * |
|
| 234 | * @return mixed |
|
| 235 | */ |
|
| 236 | public function positionalStatement($query, array $bindings = []) |
|
| 237 | { |
|
| 238 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
| 239 | if ($me->pretending()) { |
|
| 240 | return 0; |
|
| 241 | } |
|
| 242 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
| 243 | $query->consistency($this->consistency); |
|
| 244 | $query->options['args'] = $bindings; |
|
| 245 | $bucket = $this->openBucket($this->bucket); |
|
| 246 | $result = $bucket->query($query); |
|
| 247 | ||
| 248 | return (isset($result[0])) ? $result[0] : false; |
|
| 249 | }); |
|
| 250 | } |
|
| 251 | ||
| 252 | /** |
|
| 253 | * {@inheritdoc} |
|