1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/Ninja/Transformers/ProductTransformer.php
2016-02-01 13:32:12 +11:00

22 lines
707 B
PHP

<?php namespace App\Ninja\Transformers;
use App\Models\Product;
use League\Fractal;
class ProductTransformer extends EntityTransformer
{
public function transform(Product $product)
{
return [
'id' => (int) $product->public_id,
'product_key' => $product->product_key,
'notes' => $product->notes,
'cost' => $product->cost,
'qty' => $product->qty,
'account_key' =>$this->account->account_key,
'default_tax_rate_id' =>$product->default_tax_rate_id,
'updated_at' =>$this->getTimestamp($product->updated_at),
'archived_at' => $this->getTimestamp($product->deleted_at),
];
}
}