Skip to content

Commit

Permalink
Merge pull request #239 from rvdlee-salesupply/master
Browse files Browse the repository at this point in the history
Adding deferred values from deferred attributes when $withDeferred is…
  • Loading branch information
stephangroen authored Feb 1, 2018
2 parents 844ecd8 + ebc47e9 commit 250ecf4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Picqer/Financials/Exact/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ public function json($options = 0, $withDeferred = false)

$attributes[$attribute] = [];
foreach ($collection as $value) {
if(!empty($value->deferred)) {
$value->attributes = array_merge($value->attributes, $value->deferred);
}

if (is_a($value, 'Picqer\Financials\Exact\Model')) {
array_push($attributes[$attribute], $value->attributes);
} else {
Expand Down

0 comments on commit 250ecf4

Please sign in to comment.