1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00
invoiceninja/app/Ninja/Transformers/VendorContactTransformer.php

23 lines
762 B
PHP
Raw Normal View History

2016-01-06 20:52:09 +01:00
<?php namespace App\Ninja\Transformers;
use App\Models\Account;
use App\Models\VendorContact;
use League\Fractal;
2016-01-07 16:21:13 +01:00
// vendor
2016-01-06 20:52:09 +01:00
class VendorContactTransformer extends EntityTransformer
{
public function transform(VendorContact $contact)
{
return [
'id' => (int) $contact->public_id,
'first_name' => $contact->first_name,
'last_name' => $contact->last_name,
'email' => $contact->email,
'updated_at' => $this->getTimestamp($contact->updated_at),
'archived_at' => $this->getTimestamp($contact->deleted_at),
'is_primary' => (bool) $contact->is_primary,
'phone' => $contact->phone,
'account_key' => $this->account->account_key,
];
}
}