Skip to content

Commit

Permalink
Adding deferred values from deferred attributes when $withDeferred is…
Browse files Browse the repository at this point in the history
… true.
  • Loading branch information
rvdlee-salesupply committed Jan 29, 2018
1 parent 7357280 commit ebc47e9
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 @@ -218,6 +218,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 ebc47e9

Please sign in to comment.