Skip to content

Commit

Permalink
Merge pull request #469 from cjsoftuk/allow-replace-on-saveall
Browse files Browse the repository at this point in the history
saveAll does not allow reload of IDs
  • Loading branch information
calcinai authored Feb 6, 2019
2 parents b3734ba + a3ef9e3 commit ae8e8ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/XeroPHP/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public function save(Remote\Model $object, $replace_data = false)
* @return Remote\Response
* @throws Exception
*/
public function saveAll($objects, $checkGuid = true)
public function saveAll($objects, $checkGuid = true, $replace_data = false)
{
$objects = array_values($objects);

Expand Down Expand Up @@ -357,7 +357,7 @@ public function saveAll($objects, $checkGuid = true)

foreach ($response->getElements() as $element_index => $element) {
if ($response->getErrorsForElement($element_index) === null) {
$objects[$element_index]->fromStringArray($element);
$objects[$element_index]->fromStringArray($element, $replace_data);
$objects[$element_index]->setClean();
}
}
Expand Down

0 comments on commit ae8e8ff

Please sign in to comment.