Skip to content

Commit 84e162e

Browse files
authored
Merge pull request arangodb#213 from hwde/isNew
fix the isNew flag in options
2 parents 444a048 + 928c040 commit 84e162e

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

lib/ArangoDBClient/BatchPart.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ public function getProcessedResponse()
247247
$response = $this->getResponse();
248248
switch ($this->_type) {
249249
case 'getdocument':
250-
$json = $response->getJson();
251-
$options = $this->getCursorOptions();
252-
$options['isNew'] = false;
253-
$response = $_documentClass::createFromArray($json, $options);
250+
$json = $response->getJson();
251+
$options = $this->getCursorOptions();
252+
$options['_isNew'] = false;
253+
$response = $_documentClass::createFromArray($json, $options);
254254
break;
255255
case 'document':
256256
$json = $response->getJson();
@@ -260,10 +260,10 @@ public function getProcessedResponse()
260260
}
261261
break;
262262
case 'getedge':
263-
$json = $response->getJson();
264-
$options = $this->getCursorOptions();
265-
$options['isNew'] = false;
266-
$response = Edge::createFromArray($json, $options);
263+
$json = $response->getJson();
264+
$options = $this->getCursorOptions();
265+
$options['_isNew'] = false;
266+
$response = Edge::createFromArray($json, $options);
267267
break;
268268
case 'edge':
269269
$json = $response->getJson();
@@ -284,8 +284,8 @@ public function getProcessedResponse()
284284
}
285285
break;
286286
case 'cursor':
287-
$options = $this->getCursorOptions();
288-
$options['isNew'] = false;
287+
$options = $this->getCursorOptions();
288+
$options['_isNew'] = false;
289289

290290
$options = array_merge(['_documentClass' => $this->_documentClass], $options);
291291
$response = new Cursor($this->_batch->getConnection(), $response->getJson(), $options);

lib/ArangoDBClient/CollectionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ public function byExample($collectionId, $document, array $options = [])
12511251

12521252
$response = $this->getConnection()->put(Urls::URL_EXAMPLE, $this->json_encode_wrapper($body));
12531253

1254-
$options['isNew'] = false;
1254+
$options['_isNew'] = false;
12551255

12561256
$options = array_merge(['_documentClass' => $this->_documentClass], $options);
12571257

@@ -1362,7 +1362,7 @@ public function fulltext($collection, $attribute, $query, array $options = [])
13621362

13631363
$response = $this->getConnection()->put(Urls::URL_FULLTEXT, $this->json_encode_wrapper($body));
13641364

1365-
$options['isNew'] = false;
1365+
$options['_isNew'] = false;
13661366

13671367
$options = array_merge(['_documentClass' => $this->_documentClass], $options);
13681368

lib/ArangoDBClient/Cursor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ public function __construct(Connection $connection, array $data, array $options)
204204
$this->setDocumentClass($options['_documentClass']);
205205
}
206206

207-
$options['isNew'] = false;
208-
$this->_options = $options;
209-
$this->_result = [];
207+
$options['_isNew'] = false;
208+
$this->_options = $options;
209+
$this->_result = [];
210210
$this->add((array) $data[self::ENTRY_RESULT]);
211211
$this->updateLength();
212212

0 commit comments

Comments
 (0)