1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Transformers/QuoteInvitationTransformer.php

40 lines
1.4 KiB
PHP
Raw Normal View History

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
2023-01-28 23:21:40 +01:00
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Transformers;
use App\Models\QuoteInvitation;
use App\Utils\Traits\MakesHash;
class QuoteInvitationTransformer extends EntityTransformer
{
use MakesHash;
public function transform(QuoteInvitation $invitation)
{
return [
'id' => $this->encodePrimaryKey($invitation->id),
'client_contact_id' => $this->encodePrimaryKey($invitation->client_contact_id),
'key' => $invitation->key,
'link' => $invitation->getLink() ?: '',
'sent_date' => $invitation->sent_date ?: '',
'viewed_date' => $invitation->viewed_date ?: '',
'opened_date' => $invitation->opened_date ?: '',
2020-02-26 07:37:38 +01:00
'updated_at' => (int) $invitation->updated_at,
'archived_at' => (int) $invitation->deleted_at,
2020-02-27 00:32:44 +01:00
'created_at' => (int) $invitation->created_at,
2021-05-03 06:46:38 +02:00
'email_status' => $invitation->email_status ?: '',
'email_error' => (string) $invitation->email_error,
'message_id' => (string) $invitation->message_id ?: '',
];
}
}