1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 08:02:40 +01:00
invoiceninja/app/Transformers/RecurringInvoiceInvitationTransformer.php

39 lines
1.3 KiB
PHP
Raw Normal View History

2020-09-17 23:49:22 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2020-09-17 23:49:22 +02:00
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2020-09-17 23:49:22 +02:00
*/
namespace App\Transformers;
use App\Models\RecurringInvoiceInvitation;
use App\Utils\Traits\MakesHash;
class RecurringInvoiceInvitationTransformer extends EntityTransformer
{
use MakesHash;
public function transform(RecurringInvoiceInvitation $invitation)
{
return [
2020-10-05 23:46:47 +02:00
'id' => $this->encodePrimaryKey($invitation->id),
2020-09-17 23:49:22 +02:00
'client_contact_id' => $this->encodePrimaryKey($invitation->client_contact_id),
2020-10-05 23:46:47 +02:00
'key' => $invitation->key,
'link' => $invitation->getLink() ?: '',
'sent_date' => $invitation->sent_date ?: '',
'viewed_date' => $invitation->viewed_date ?: '',
'opened_date' => $invitation->opened_date ?: '',
2020-09-17 23:49:22 +02:00
'updated_at' => (int) $invitation->updated_at,
'archived_at' => (int) $invitation->deleted_at,
2020-10-05 23:46:47 +02:00
'created_at' => (int) $invitation->created_at,
2021-05-03 06:55:37 +02:00
'email_status' => $invitation->email_status ?: '',
2021-02-25 22:06:43 +01:00
'email_error' => (string)$invitation->email_error,
2020-09-17 23:49:22 +02:00
];
}
}