1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Add ability to include invoice invitations via API

This commit is contained in:
Laurynas Sakalauskas 2016-01-24 18:37:24 +00:00
parent 2478ec59a4
commit 91d44dd301

View File

@ -25,12 +25,22 @@ class InvoiceTransformer extends EntityTransformer
'payments'
];
protected $availableIncludes = [
'invitations',
];
public function includeInvoiceItems(Invoice $invoice)
{
$transformer = new InvoiceItemTransformer($this->account, $this->serializer);
return $this->includeCollection($invoice->invoice_items, $transformer, ENTITY_INVOICE_ITEMS);
}
public function includeInvitations(Invoice $invoice)
{
$transformer = new InvoiceItemTransformer($this->account, $this->serializer);
return $this->includeCollection($invoice->invitations, $transformer, ENTITY_INVITATION);
}
public function includePayments(Invoice $invoice)
{
$transformer = new PaymentTransformer($this->account, $this->serializer);