1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-18 09:04:35 +01:00
invoiceninja/app/Transformers/GroupSettingTransformer.php
2020-10-28 21:10:49 +11:00

51 lines
1.2 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Transformers;
use App\Models\GroupSetting;
use App\Utils\Traits\MakesHash;
use stdClass;
/**
* class ClientTransformer.
*/
class GroupSettingTransformer extends EntityTransformer
{
use MakesHash;
protected $defaultIncludes = [
];
/**
* @var array
*/
protected $availableIncludes = [
];
/**
* @param GroupSetting $group_setting
* @return array
*/
public function transform(GroupSetting $group_setting)
{
return [
'id' => $this->encodePrimaryKey($group_setting->id),
'name' => (string) $group_setting->name ?: '',
'settings' => $group_setting->settings ?: new stdClass,
'created_at' => (int) $group_setting->created_at,
'updated_at' => (int) $group_setting->updated_at,
'archived_at' => (int) $group_setting->deleted_at,
'is_deleted' => (bool) $group_setting->is_deleted,
];
}
}