1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/Ninja/Import/FreshBooks/PaymentTransformer.php

27 lines
610 B
PHP
Raw Normal View History

2015-11-18 15:40:50 +01:00
<?php namespace App\Ninja\Import\FreshBooks;
2015-12-08 11:10:20 +01:00
use App\Ninja\Import\BaseTransformer;
2015-11-18 15:40:50 +01:00
use League\Fractal\Resource\Item;
/**
* Class PaymentTransformer
*/
2015-12-08 11:10:20 +01:00
class PaymentTransformer extends BaseTransformer
2015-11-18 15:40:50 +01:00
{
/**
* @param $data
* @return Item
*/
2016-06-02 21:03:59 +02:00
public function transform($data)
2015-11-18 15:40:50 +01:00
{
2016-06-02 21:03:59 +02:00
return new Item($data, function ($data) {
2015-11-18 15:40:50 +01:00
return [
'amount' => $data->paid,
'payment_date_sql' => $data->create_date,
'client_id' => $data->client_id,
'invoice_id' => $data->invoice_id,
2015-11-18 15:40:50 +01:00
];
});
}
2016-06-02 21:03:59 +02:00
}