1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/Ninja/Transformers/QuoteTransformer.php
2015-11-12 22:36:28 +02:00

25 lines
620 B
PHP

<?php namespace App\Ninja\Transformers;
use App\Models\Invoice;
use League\Fractal;
class QuoteTransformer extends EntityTransformer
{
protected $defaultIncludes = [
'invoice_items',
];
public function includeInvoiceItems($invoice)
{
return $this->collection($invoice->invoice_items, new InvoiceItemTransformer($this->account));
}
public function transform(Invoice $invoice)
{
return [
'public_id' => (int) $invoice->public_id,
'quote_number' => $invoice->invoice_number,
'amount' => (float) $invoice->amount,
];
}
}