1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/app/Transformers/GatewayTransformer.php

58 lines
1.5 KiB
PHP
Raw Normal View History

2019-10-17 13:49:09 +02:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
2019-10-17 13:49:09 +02:00
*
* @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,
'default_gateway_type_id' => (string)$gateway->default_gateway_type_id,
2019-10-17 13:49:09 +02:00
'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,
2020-02-27 00:32:44 +01:00
'created_at' => (int)$gateway->created_at,
2019-10-17 13:49:09 +02:00
];
}
}