@@ 182-195 (lines=14) @@ | ||
179 | /** |
|
180 | * {@inheritdoc} |
|
181 | */ |
|
182 | public function affectingStatement($query, $bindings = []) |
|
183 | { |
|
184 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
185 | if ($me->pretending()) { |
|
186 | return 0; |
|
187 | } |
|
188 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
189 | $query->consistency(\CouchbaseN1qlQuery::STATEMENT_PLUS); |
|
190 | $bucket = $this->openBucket($this->bucket); |
|
191 | $result = $bucket->query($query, ['parameters' => $bindings]); |
|
192 | ||
193 | return (isset($result[0])) ? $result[0] : false; |
|
194 | }); |
|
195 | } |
|
196 | ||
197 | /** |
|
198 | * @param $query |
|
@@ 203-217 (lines=15) @@ | ||
200 | * |
|
201 | * @return mixed |
|
202 | */ |
|
203 | public function positionalStatement($query, array $bindings = []) |
|
204 | { |
|
205 | return $this->run($query, $bindings, function ($me, $query, $bindings) { |
|
206 | if ($me->pretending()) { |
|
207 | return 0; |
|
208 | } |
|
209 | $query = \CouchbaseN1qlQuery::fromString($query); |
|
210 | $query->consistency(\CouchbaseN1qlQuery::STATEMENT_PLUS); |
|
211 | $query->options['args'] = $bindings; |
|
212 | $bucket = $this->openBucket($this->bucket); |
|
213 | $result = $bucket->query($query); |
|
214 | ||
215 | return (isset($result[0])) ? $result[0] : false; |
|
216 | }); |
|
217 | } |
|
218 | ||
219 | /** |
|
220 | * {@inheritdoc} |