Include Documents in Invoice transformer
This commit is contained in:
parent
2f8b79891a
commit
2034c11795
1 changed files with 7 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue