1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-06 03:02:34 +01:00
invoiceninja/app/Transformers/InvoiceInvitationTransformer.php
2019-09-27 08:14:02 +10:00

35 lines
916 B
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Transformers;
use App\Models\Invoice;
use App\Models\InvoiceInvitation;
use App\Utils\Traits\MakesHash;
class InvoiceInvitationTransformer extends EntityTransformer
{
use MakesHash;
public function transform(InvoiceInvitation $invitation)
{
return [
'id' => $this->encodePrimaryKey($invitation->id),
'key' => $invitation->getName() ?: '',
'link' => $invitation->getLink() ?: '',
'sent_date' => $invitation->sent_date ?: '',
'viewed_date' => $invitation->sent_date ?: '',
'opened_date' => $invitation->opened_date ?: '',
];
}
}