Include Documents in Invoice transformer

This commit is contained in:
David Bomba 2016-05-19 09:43:03 +10:00
parent 2f8b79891a
commit 2034c11795

View File

@ -28,7 +28,7 @@ class InvoiceTransformer extends EntityTransformer
'invitations',
'payments',
'client',
//'expenses',
'documents',
];
public function __construct($account = null, $serializer = null, $client = null)
@ -68,6 +68,12 @@ class InvoiceTransformer extends EntityTransformer
return $this->includeCollection($invoice->expenses, $transformer, ENTITY_EXPENSE);
}
public function includeDocuments(Invoice $invoice)
{
$transformer = new DocumentTransformer($this->account, $this->serializer);
return $this->includeCollection($invoice->documents, $transformer, ENTITY_DOCUMENT);
}
public function transform(Invoice $invoice)
{