This commit is contained in:
James Cole 2019-09-22 22:10:39 +02:00
parent 5214f87003
commit 0340ed6f19
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -84,7 +84,10 @@ class PiggyBankEventTransformer extends AbstractTransformer
// get associated journal and transaction, if any:
$journalId = (int)$event->transaction_journal_id;
$groupId = null;
if (0 !== $journalId) {
$groupId = (int)$event->transactionJournal->transaction_group_id;
}
$data = [
'id' => (int)$event->id,
'created_at' => $event->created_at->toAtomString(),
@ -95,6 +98,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'transaction_journal_id' => $journalId,
'transaction_group_id' => $groupId,
'links' => [
[
'rel' => 'self',