From ebc47e9b84eb3e1e0ca91cf8d16db0d5b12411dd Mon Sep 17 00:00:00 2001 From: Rob van der Lee Date: Mon, 29 Jan 2018 15:34:04 +0100 Subject: [PATCH] Adding deferred values from deferred attributes when $withDeferred is true. --- src/Picqer/Financials/Exact/Model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Picqer/Financials/Exact/Model.php b/src/Picqer/Financials/Exact/Model.php index 8ac72ede..ec1ceba6 100644 --- a/src/Picqer/Financials/Exact/Model.php +++ b/src/Picqer/Financials/Exact/Model.php @@ -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 {