1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00
invoiceninja/app/Transformers/GatewayTransformer.php
David Bomba a6f928b181
Fixes for settings, implement invitations from invoice request (#3047)
* Fixes for client portal localization

* Replace Invoice Ninja Logo with user defined logo and website URL in client portal

* Minor Fixes

* Refactor for invitations on invoices

* Fixes for settings
2019-11-07 09:57:09 +11:00

56 lines
1.4 KiB
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\Gateway;
use App\Utils\Traits\MakesHash;
/**
* class ClientTransformer
*/
class GatewayTransformer extends EntityTransformer
{
use MakesHash;
protected $defaultIncludes = [
];
/**
* @var array
*/
protected $availableIncludes = [
];
/**
* @param Client $client
*
* @return array
*/
public function transform(Gateway $gateway)
{
return [
'id' => $this->encodePrimaryKey($gateway->id),
'name' => (string)$gateway->name ?: '',
'key' => (string)$gateway->key ?: '',
'provider' => (string)$gateway->provider ?: '',
'visible' => (bool)$gateway->visible,
'sort_order' => (int)$gateway->sort_order,
//'recommended' => (bool)$gateway->recommended,
'site_url' => (string)$gateway->site_url ?: '',
'is_offsite' => (bool)$gateway->is_offsite,
'is_secure' => (bool)$gateway->is_secure,
'fields' => (string)$gateway->fields ?: '',
'updated_at' => (int)$gateway->updated_at,
];
}
}