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