1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/Ninja/Transformers/ContactTransformer.php
2015-11-27 14:55:28 +02:00

25 lines
792 B
PHP

<?php namespace App\Ninja\Transformers;
use App\Models\Account;
use App\Models\Contact;
use League\Fractal;
class ContactTransformer extends EntityTransformer
{
public function transform(Contact $contact)
{
return [
'id' => (int) $contact->public_id,
'first_name' => $contact->first_name,
'last_name' => $contact->last_name,
'email' => $contact->email,
'user_id' => (int) $contact->user_id,
'updated_at' => $contact->updated_at,
'deleted_at' => $contact->deleted_at,
'is_primary' => (bool) $contact->is_primary,
'phone' => $contact->phone,
'last_login' => $contact->last_login,
'account_key' => $this->account->account_key,
];
}
}