mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Merge pull request #881 from turbo124/develop
Include Documents in Invoice transformer
This commit is contained in:
commit
990ba1a89c
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user